APIs description¶
Doxygen complete API documentation¶
Available classes¶
SRX_MODEL_FFT¶
-
class SRX_MODEL_FFT¶
This class represents the SRX_MODEL_FFT.
The SRX_MODEL_FFT class is responsible for performing Fast Fourier Transform (FFT) calculations on input signals. It Generates FFT positive part vector. Include data buffering, FFT decomposition, real part, and scaling.
Note
The FFT vector output gets arbitrary frequency axis. To link these values to physical frequency, the input signal sampling rate has to be known. As the buffering is included, the way to use the class is to call step() at constant rate, and getting the output fft vector when needed. The corresponding frequency is given by the step of the FFT (ie: 500Hz application using a 256 size FFT, the block will output a vector with a size of 128. To get the frequency associated with the vector, you must do step=500/256, the vector is graduated this way vect = [0:step:500/2-step] = [0 1.95 3.9 … 247.65] Hz)
Public Functions
-
void step()¶
Run one step of the model.
This function has to be called at the rate of the model (0.001s)
-
void initialize()¶
Initialize the model and interfaces.
-
void setInputs(const modelInputs &inputs)¶
Set the Inputs used by the model.
- Parameters:
inputs – is the struct containing the inputs
-
inline const modelOutputs &getOutputs()¶
Get the Outputs of the model.
- Returns:
the struct containing the outputs
-
struct modelInputs¶
This structure contains the inputs of the model.
This structure has to be at least partially filled and passed to the model at each step.
Public Members
-
float signalInput = 0.F¶
Signal input consumed by the FFT algorithm.
-
float signalInput = 0.F¶
-
struct modelOutputs¶
This struct contains the outputs of the model.
Public Members
-
const float *fftVector = nullptr¶
FFT vector positive part.
The FFT full vector is has a size of FFT_INPUT_SIZE. Only the part with positive frequencies is kept ie: [size/2+1:end] part. For example, with a 500Hz application using a 256 size FFT, the block will output a vector with a size of 128. To get the frequency associated with the vector, you must do step=500/256, the vector is graduated this way vect = [0:step:500/2-step]
-
const float *fftVector = nullptr¶
-
void step()¶