Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
pprz_chirp.h File Reference
#include "std.h"
+ Include dependency graph for pprz_chirp.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  chirp_t
 Initialize with chirp_init. More...
 

Functions

void chirp_init (struct chirp_t *chirp, float f0_hz, float f1_hz, float length_s, float current_time_s, bool exponential_chirp, bool fade_in)
 Allocate and initialize a new chirp struct. More...
 
void chirp_reset (struct chirp_t *chirp, float current_time_s)
 Reset the time of the chirp. More...
 
bool chirp_is_running (struct chirp_t *chirp, float current_time_s)
 Return if the current_time is within the chirp manoeuvre. More...
 
float chirp_update (struct chirp_t *chirp, float current_time_s)
 Calculate the value at current_time_s and update the struct with current frequency and value. More...
 

Data Structure Documentation

◆ chirp_t

struct chirp_t

Initialize with chirp_init.

Definition at line 59 of file pprz_chirp.h.

Data Fields
float current_frequency_hz
float current_time_s
float current_value
bool exponential_chirp
float f0_hz
float f1_hz
bool fade_in
float length_s
float percentage_done
float start_time_s
float total_length_s

Function Documentation

◆ chirp_init()

void chirp_init ( struct chirp_t chirp,
float  f0_hz,
float  f1_hz,
float  length_s,
float  current_time_s,
bool  exponential_chirp,
bool  fade_in 
)

Allocate and initialize a new chirp struct.

set start_time to the current time

Parameters
f0_hzMinimum frequency of the chirp in Hz
f1_hzMaximum frequency of the chirp in Hz
length_sTime interval in s (starting from start_time_s) in which the chirp should be carried out, excluding fade-in time
current_time_sCurrent time in s, starting point of the chirp
exponential_chirpIf true, use exponential-time chirp, otherwise use linear-time chirp (see wikipedia)
fade_inIf true, begin the chirp with 2 wavelengths of the lowest frequency, with increasing amplitude

Definition at line 34 of file pprz_chirp.c.

References chirp, chirp_t::current_frequency_hz, chirp_t::current_value, chirp_t::exponential_chirp, chirp_t::f0_hz, chirp_t::f1_hz, chirp_t::fade_in, chirp_t::length_s, chirp_t::percentage_done, chirp_t::start_time_s, and chirp_t::total_length_s.

Referenced by sys_id_chirp_activate_handler(), and sys_id_chirp_init().

+ Here is the caller graph for this function:

◆ chirp_is_running()

bool chirp_is_running ( struct chirp_t chirp,
float  current_time_s 
)

Return if the current_time is within the chirp manoeuvre.

Definition at line 65 of file pprz_chirp.c.

References chirp, chirp_t::start_time_s, and chirp_t::total_length_s.

Referenced by chirp_update(), and sys_id_chirp_run().

+ Here is the caller graph for this function:

◆ chirp_reset()

void chirp_reset ( struct chirp_t chirp,
float  current_time_s 
)

Reset the time of the chirp.

Parameters
chirpThe chirp struct pointer to reset
current_time_sThe time to set the chirp start at

Definition at line 56 of file pprz_chirp.c.

References chirp, chirp_t::current_frequency_hz, chirp_t::current_time_s, chirp_t::current_value, chirp_t::percentage_done, and chirp_t::start_time_s.

Referenced by start_chirp(), and stop_chirp().

+ Here is the caller graph for this function:

◆ chirp_update()

float chirp_update ( struct chirp_t chirp,
float  current_time_s 
)

Calculate the value at current_time_s and update the struct with current frequency and value.

Returns
Current value chirp->current_value

Definition at line 71 of file pprz_chirp.c.

References chirp, CHIRP_C1, CHIRP_C2, chirp_is_running(), chirp_t::current_frequency_hz, chirp_t::current_time_s, chirp_t::current_value, chirp_t::exponential_chirp, chirp_t::f0_hz, chirp_t::f1_hz, chirp_t::fade_in, K, chirp_t::length_s, Min, chirp_t::percentage_done, chirp_t::start_time_s, and chirp_t::total_length_s.

Referenced by sys_id_chirp_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: