Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
transport_delay.h File Reference

Transport delay filter implementation. More...

#include "paparazzi.h"
+ Include dependency graph for transport_delay.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TransportDelay
 

Macros

#define TRANSPORT_DELAY_BUFFER_SIZE   20
 

Functions

static void init_transport_delay (struct TransportDelay *td, uint8_t delay_samples, const float initial_value)
 Initialize a transport delay buffer.
 
static float update_transport_delay (struct TransportDelay *td, const float input)
 Propagate a new input value through the transport delay buffer.
 
static void reset_transport_delay (struct TransportDelay *td, const float initial_value)
 Reset the transport delay buffer to a specific initial value.
 
static float get_transport_delay (const struct TransportDelay *td)
 Get the current output value from the transport delay buffer without updating it.
 

Detailed Description

Transport delay filter implementation.

Definition in file transport_delay.h.


Data Structure Documentation

◆ TransportDelay

struct TransportDelay

Definition at line 31 of file transport_delay.h.

Data Fields
float buffer[TRANSPORT_DELAY_BUFFER_SIZE]
uint8_t delay_samples
uint8_t write_index

Macro Definition Documentation

◆ TRANSPORT_DELAY_BUFFER_SIZE

#define TRANSPORT_DELAY_BUFFER_SIZE   20

Definition at line 29 of file transport_delay.h.

Function Documentation

◆ get_transport_delay()

static float get_transport_delay ( const struct TransportDelay td)
inlinestatic

Get the current output value from the transport delay buffer without updating it.

Parameters
tdPointer to the transport_delay_t structure.
Returns
Current delayed output value from the buffer.

Definition at line 97 of file transport_delay.h.

References foo, and TRANSPORT_DELAY_BUFFER_SIZE.

Referenced by get_transport_delay_array().

+ Here is the caller graph for this function:

◆ init_transport_delay()

static void init_transport_delay ( struct TransportDelay td,
uint8_t  delay_samples,
const float  initial_value 
)
inlinestatic

Initialize a transport delay buffer.

Parameters
[out]tdPointer to the transport_delay_t structure to initialize.
[in]delay_samplesNumber of samples to delay. If this value exceeds TRANSPORT_DELAY_BUFFER_SIZE, it will be clamped to TRANSPORT_DELAY_BUFFER_SIZE.
[in]initial_valueInitial value to fill the buffer with.
Note
: If delay_samples > TRANSPORT_DELAY_BUFFER_SIZE, it will be clamped to TRANSPORT_DELAY_BUFFER_SIZE and the requested delay will not be fully honored.

Definition at line 49 of file transport_delay.h.

References foo, and TRANSPORT_DELAY_BUFFER_SIZE.

Referenced by init_transport_delay_array().

+ Here is the caller graph for this function:

◆ reset_transport_delay()

static void reset_transport_delay ( struct TransportDelay td,
const float  initial_value 
)
inlinestatic

Reset the transport delay buffer to a specific initial value.

Parameters
[in,out]tdPointer to the transport_delay_t structure.
[in]initial_valueValue to reset the buffer elements to.

Definition at line 83 of file transport_delay.h.

References foo, and TRANSPORT_DELAY_BUFFER_SIZE.

Referenced by reset_transport_delay_array().

+ Here is the caller graph for this function:

◆ update_transport_delay()

static float update_transport_delay ( struct TransportDelay td,
const float  input 
)
inlinestatic

Propagate a new input value through the transport delay buffer.

Parameters
[in,out]tdPointer to the transport_delay_t structure.
[in]inputNew input value to add to the buffer.
Returns
Delayed output value from the buffer.

Definition at line 68 of file transport_delay.h.

References foo, and TRANSPORT_DELAY_BUFFER_SIZE.

Referenced by update_transport_delay_array().

+ Here is the caller graph for this function: