TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

Library Functions. More...

Functions

TM_FILTER_FIR_F32_tTM_FILTER_FIR_F32_Init (size_t coeff_size, const float32_t *coeffs, float32_t *StateBuffer, size_t block_size)
 Creates and initializes ARM FIR filter using F32 coefficients. More...
 
TM_FILTER_FIR_F32_tTM_FILTER_FIR_F32_Process (TM_FILTER_FIR_F32_t *instance, float32_t *In, float32_t *Out)
 Process data through ARM FIR F32 filter. More...
 
TM_FILTER_FIR_F32_tTM_FILTER_FIR_F32_ProcessAll (TM_FILTER_FIR_F32_t *instance, float32_t *In, float32_t *Out, size_t count)
 Process all input data through ARM FIR F32 filter. More...
 
TM_FILTER_FIR_F32_tTM_FILTER_FIR_F32_Clear (TM_FILTER_FIR_F32_t *instance)
 Clear filter's state buffer, set values to 0. More...
 
void TM_FILTER_FIR_F32_DeInit (TM_FILTER_FIR_F32_t *instance)
 Deallocates ARM FIR filter with all allocated buffers. More...
 
TM_FILTER_IIR_F32_tTM_FILTER_IIR_F32_Init (size_t numStages, const float32_t *coeffs, float32_t *StateBuffer, size_t block_size)
 Creates and initializes ARM IIR biquad direct form 1 filter using F32 coefficients. More...
 
TM_FILTER_IIR_F32_tTM_FILTER_IIR_F32_Process (TM_FILTER_IIR_F32_t *instance, float32_t *In, float32_t *Out)
 Processes ARM IIR biquad direct form 1 filter using F32 coefficients. More...
 
TM_FILTER_IIR_F32_tTM_FILTER_IIR_F32_ProcessAll (TM_FILTER_IIR_F32_t *instance, float32_t *In, float32_t *Out, size_t count)
 Processes ARM IIR biquad direct form 1 filter using F32 coefficients. More...
 
TM_FILTER_IIR_F32_tTM_FILTER_IIR_F32_Clear (TM_FILTER_IIR_F32_t *instance)
 Clears all filter states and set them to zero. More...
 
void TM_FILTER_IIR_F32_DeInit (TM_FILTER_IIR_F32_t *instance)
 Deallocates ARM IIR biquad direct form 1 filter with state buffer. More...
 

Detailed Description

Library Functions.

Function Documentation

TM_FILTER_FIR_F32_t* TM_FILTER_FIR_F32_Clear ( TM_FILTER_FIR_F32_t instance)

Clear filter's state buffer, set values to 0.

Parameters
instancePointer to TM_FILTER_FIR_F32_t instance
Return values
Pointerto TM_FILTER_FIR_F32_t structure
void TM_FILTER_FIR_F32_DeInit ( TM_FILTER_FIR_F32_t instance)

Deallocates ARM FIR filter with all allocated buffers.

Parameters
Pointerto TM_FILTER_FIR_F32_t which will be used for deinit
Return values
None
TM_FILTER_FIR_F32_t* TM_FILTER_FIR_F32_Init ( size_t  coeff_size,
const float32_t *  coeffs,
float32_t *  StateBuffer,
size_t  block_size 
)

Creates and initializes ARM FIR filter using F32 coefficients.

Note
Malloc is used to initialize proper size of heap memory
Parameters
coeff_sizeNumber of cofficients for FIR filtering. When possible, use coeff_size multiply of 8 elements, because filtering process is designed for this coeff size to be fastest
*coeffsPointer to coefficients FIR filter array coeff_size length
*StateBufferPointer to state buffer. Set to null to let malloc allocate memory in heap
block_sizesize of block for FIR filtering. Number of elements for filtering at a time. When possible, use block_size multiply of 8 samples, because filtering process is designed for this block size to be fastest
Return values
Pointerto TM_FILTER_FIR_F32_t instance or NULL if allocation failed
TM_FILTER_FIR_F32_t* TM_FILTER_FIR_F32_Process ( TM_FILTER_FIR_F32_t instance,
float32_t *  In,
float32_t *  Out 
)

Process data through ARM FIR F32 filter.

Parameters
*instancePointer to TM_FILTER_FIR_F32_t instance
*InInput data array to process in filter. Length must be the same as block_size parameter in initialization
*OutOutput data array to store filtered values. Length must be the same as block_size parameter in initialization
Return values
Pointerto TM_FILTER_FIR_F32_t instance
TM_FILTER_FIR_F32_t* TM_FILTER_FIR_F32_ProcessAll ( TM_FILTER_FIR_F32_t instance,
float32_t *  In,
float32_t *  Out,
size_t  count 
)

Process all input data through ARM FIR F32 filter.

Parameters
*instancePointer to TM_FILTER_FIR_F32_t instance
*InInput data array to process in filter
*OutOutput data array to store filtered values
countNumber of elements in input array and output array. Length must be multiply of block size set on initialization
Return values
Pointerto TM_FILTER_FIR_F32_t instance
TM_FILTER_IIR_F32_t* TM_FILTER_IIR_F32_Clear ( TM_FILTER_IIR_F32_t instance)

Clears all filter states and set them to zero.

Parameters
*instancePointer to TM_FILTER_IIR_F32_t structure where states will be set to zero
Return values
Pointerto TM_FILTER_IIR_F32_t structure
void TM_FILTER_IIR_F32_DeInit ( TM_FILTER_IIR_F32_t instance)

Deallocates ARM IIR biquad direct form 1 filter with state buffer.

Parameters
Pointerto TM_FILTER_IIR_F32_t which will be used for deinit
Return values
None
TM_FILTER_IIR_F32_t* TM_FILTER_IIR_F32_Init ( size_t  numStages,
const float32_t *  coeffs,
float32_t *  StateBuffer,
size_t  block_size 
)

Creates and initializes ARM IIR biquad direct form 1 filter using F32 coefficients.

Parameters
numStagesNumber of 2nd order stages with b0, b1, b2 (numerators), a0, a1 (denumerators) coefficients
*coeffsPointer to coeffs array. Coefficients length must be 5 * numStages parameter. Parameters are stored in format: {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...} where first number represents stage number and second coefficient number for A and B coefficients.
*StateBufferPointer to state buffer. It's length must be for at least 4 * numStages elements. Set to null to let malloc allocate memory in heap
block_sizeNumber of samples to use when processing filter using IIR_Filter_Process_F32 function When possible, use block_size multiply of 8 samples, because filtering process is designed for this block size to be fastest
Return values
Pointerto allocated TM_FILTER_IIR_F32_t structure or NULL if allocation failed
TM_FILTER_IIR_F32_t* TM_FILTER_IIR_F32_Process ( TM_FILTER_IIR_F32_t instance,
float32_t *  In,
float32_t *  Out 
)

Processes ARM IIR biquad direct form 1 filter using F32 coefficients.

Parameters
*instancePointer to TM_FILTER_IIR_F32_t structure with filled input buffer with input data
*InInput data array to process in filter. Length must be the same as block_size parameter in initialization
*OutOutput data array to store filtered values. Length must be the same as block_size parameter in initialization
Return values
Pointerto TM_FILTER_IIR_F32_t structure
TM_FILTER_IIR_F32_t* TM_FILTER_IIR_F32_ProcessAll ( TM_FILTER_IIR_F32_t instance,
float32_t *  In,
float32_t *  Out,
size_t  count 
)

Processes ARM IIR biquad direct form 1 filter using F32 coefficients.

Parameters
*instancePointer to TM_FILTER_IIR_F32_t structure with filled input buffer with input data
*InInput data array to process in filter
*OutOutput data array to store filtered values
countNumber of elements in input array and output array. Length must be multiply of block size set on initialization
Return values
Pointerto TM_FILTER_IIR_F32_t structure