|
ESP-IDF Firmware
Firmware architecture and call graph
|
Go to the source code of this file.
Data Structures | |
| struct | fir_f32_s |
| Data struct of f32 fir filter. More... | |
| struct | fir_s16_s |
| Data struct of s16 fir filter. More... | |
Macros | |
| #define | dsps_fir_f32 dsps_fir_f32_ansi |
| #define | dsps_fird_f32 dsps_fird_f32_ansi |
| #define | dsps_firmr_f32 dsps_firmr_f32_ansi |
| #define | dsps_fird_s16 dsps_fird_s16_ansi |
| #define | dsps_firmr_s16 dsps_firmr_s16_ansi |
Typedefs | |
| typedef struct fir_f32_s | fir_f32_t |
| Data struct of f32 fir filter. | |
| typedef struct fir_s16_s | fir_s16_t |
| Data struct of s16 fir filter. | |
Functions | |
| esp_err_t | dsps_fir_init_f32 (fir_f32_t *fir, float *coeffs, float *delay, int coeffs_len) |
| initialize structure for 32 bit FIR filter | |
| esp_err_t | dsps_fird_init_f32 (fir_f32_t *fir, float *coeffs, float *delay, int N, int decim) |
| initialize structure for 32 bit Decimation FIR filter Function initialize structure for 32 bit floating point FIR filter with decimation The implementation use ANSI C and could be compiled and run on any platform | |
| esp_err_t | dsps_fird_init_s16 (fir_s16_t *fir, int16_t *coeffs, int16_t *delay, int16_t coeffs_len, int16_t decim, int16_t start_pos, int16_t shift) |
| initialize structure for 16 bit Decimation FIR filter Function initialize structure for 16 bit signed fixed point FIR filter with decimation The implementation use ANSI C and could be compiled and run on any platform | |
| esp_err_t | dsps_fir_f32_ansi (fir_f32_t *fir, const float *input, float *output, int len) |
| 32 bit floating point FIR filter | |
| esp_err_t | dsps_fir_f32_ae32 (fir_f32_t *fir, const float *input, float *output, int len) |
| esp_err_t | dsps_fir_f32_aes3 (fir_f32_t *fir, const float *input, float *output, int len) |
| int | dsps_fird_f32_ansi (fir_f32_t *fir, const float *input, float *output, int len) |
| 32 bit floating point Decimation FIR filter | |
| int | dsps_fird_f32_ae32 (fir_f32_t *fir, const float *input, float *output, int len) |
| int | dsps_fird_f32_aes3 (fir_f32_t *fir, const float *input, float *output, int len) |
| int | dsps_fird_f32_arp4 (fir_f32_t *fir, const float *input, float *output, int len) |
| int32_t | dsps_fird_s16_ansi (fir_s16_t *fir, const int16_t *input, int16_t *output, int32_t len) |
| 16 bit signed fixed point Decimation FIR filter | |
| int32_t | dsps_fird_s16_ae32 (fir_s16_t *fir, const int16_t *input, int16_t *output, int32_t len) |
| int32_t | dsps_fird_s16_aes3 (fir_s16_t *fir, const int16_t *input, int16_t *output, int32_t len) |
| int32_t | dsps_fird_s16_arp4 (fir_s16_t *fir, const int16_t *input, int16_t *output, int32_t len) |
| esp_err_t | dsps_firmr_init_f32 (fir_f32_t *fir, float *coeffs, float *delay, int length, int interp, int decim, int start_pos) |
| initialize structure for multi-rate FIR filter Function initialize structure for 32 bit floating point multi-rate FIR filter The implementation use ANSI C and could be compiled and run on any platform | |
| esp_err_t | dsps_firmr_init_s16 (fir_s16_t *fir, int16_t *coeffs, int16_t *delay, int16_t length, int16_t interp, int16_t decim, int16_t start_pos, int16_t shift) |
| initialize structure for multi-rate FIR filter Function initialize structure for 16 bit signed fixed point multi-rate FIR filter The implementation use ANSI C and could be compiled and run on any platform | |
| int | dsps_firmr_f32_ansi (fir_f32_t *fir, const float *input, float *output, int input_len) |
| 32 bit floating point multi-rate FIR filter | |
| int32_t | dsps_firmr_s16_ansi (fir_s16_t *fir, const int16_t *input, int16_t *output, int32_t input_len) |
| 16 bit signed fixed point multi-rate FIR filter | |
| esp_err_t | dsps_fird_s16_aexx_free (fir_s16_t *fir) |
| support arrays freeing function | |
| esp_err_t | dsps_fir_f32_free (fir_f32_t *fir) |
| support arrays freeing function | |
| esp_err_t | dsps_16_array_rev (int16_t *arr, int16_t len) |
| Array reversal. | |
| #define dsps_fir_f32 dsps_fir_f32_ansi |
Definition at line 378 of file dsps_fir.h.
| #define dsps_fird_f32 dsps_fird_f32_ansi |
Definition at line 379 of file dsps_fir.h.
| #define dsps_fird_s16 dsps_fird_s16_ansi |
Definition at line 381 of file dsps_fir.h.
| #define dsps_firmr_f32 dsps_firmr_f32_ansi |
Definition at line 380 of file dsps_fir.h.
Referenced by dsps_resampler_mr_init().
| #define dsps_firmr_s16 dsps_firmr_s16_ansi |
Definition at line 382 of file dsps_fir.h.
Referenced by dsps_resampler_mr_init().
Data struct of f32 fir filter.
This structure is used by a filter internally. A user should access this structure only in case of extensions for the DSP Library. All fields of this structure are initialized by the dsps_fir_init_f32(...) function.
Data struct of s16 fir filter.
This structure is used by a filter internally. A user should access this structure only in case of extensions for the DSP Library. All fields of this structure are initialized by the dsps_fir_init_s16(...) function.
| esp_err_t dsps_16_array_rev | ( | int16_t * | arr, |
| int16_t | len ) |
Array reversal.
Function reverses 16-bit long array members for the purpose of the dsps_fird_s16_aes3 implementation The function has to be called either during the fir struct initialization or every time the coefficients change
| arr | pointer to the array to be reversed |
| len | length of the array to be reversed |
Definition at line 146 of file dsps_fird_init_s16.c.
References ESP_OK.
32 bit floating point FIR filter
Function implements FIR filter The extension (_ansi) uses ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.
| fir | pointer to fir filter structure, that must be initialized before | |
| [in] | input | input array |
| [out] | output | array with the result of FIR filter |
| [in] | len | length of input and result arrays |
Definition at line 17 of file dsps_fir_f32_ansi.c.
References fir_f32_s::coeffs, fir_f32_s::delay, ESP_OK, fir_f32_s::N, N, n, and fir_f32_s::pos.
Referenced by test_fir().
support arrays freeing function
Function frees the delay line arrays, if it was allocated by the init functions.
| fir | pointer to fir filter structure, that must be initialized before |
Definition at line 60 of file dsps_fir_init_f32.c.
References fir_f32_s::delay, ESP_OK, and fir_f32_s::use_delay.
Referenced by dsps_resampler_mr_free().
initialize structure for 32 bit FIR filter
Function initialize structure for 32 bit floating point FIR filter The implementation use ANSI C and could be compiled and run on any platform
| fir | pointer to fir filter structure, that must be preallocated |
| coeffs | array with FIR filter coefficients. Must be length N |
| delay | array for FIR filter delay line. Must have a length = coeffs_len + 4 |
| coeffs_len | FIR filter length. Length of coeffs array. For esp32s3 length should be divided by 4 and aligned to 16. |
Definition at line 19 of file dsps_fir_init_f32.c.
References coeffs, fir_f32_s::coeffs, delay, fir_f32_s::delay, ESP_ERR_DSP_ARRAY_NOT_ALIGNED, ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, memalign, fir_f32_s::N, fir_f32_s::pos, and fir_f32_s::use_delay.
Referenced by test_fir().
| int dsps_fird_f32_ae32 | ( | fir_f32_t * | fir, |
| const float * | input, | ||
| float * | output, | ||
| int | len ) |
| int dsps_fird_f32_aes3 | ( | fir_f32_t * | fir, |
| const float * | input, | ||
| float * | output, | ||
| int | len ) |
| int dsps_fird_f32_ansi | ( | fir_f32_t * | fir, |
| const float * | input, | ||
| float * | output, | ||
| int | len ) |
32 bit floating point Decimation FIR filter
Function implements FIR filter with decimation The extension (_ansi) uses ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.
| fir | pointer to fir filter structure, that must be initialized before |
| input | input array |
| output | array with the result of FIR filter |
| len | length of result array |
Definition at line 17 of file dsps_fird_f32_ansi.c.
References fir_f32_s::coeffs, fir_f32_s::decim, fir_f32_s::delay, k, fir_f32_s::N, N, n, and fir_f32_s::pos.
| int dsps_fird_f32_arp4 | ( | fir_f32_t * | fir, |
| const float * | input, | ||
| float * | output, | ||
| int | len ) |
initialize structure for 32 bit Decimation FIR filter Function initialize structure for 32 bit floating point FIR filter with decimation The implementation use ANSI C and could be compiled and run on any platform
| fir | pointer to fir filter structure, that must be preallocated |
| coeffs | array with FIR filter coefficients. Must be length N |
| delay | array for FIR filter delay line. Must be length N |
| N | FIR filter length. Length of coeffs and delay arrays. |
| decim | decimation factor. |
Definition at line 18 of file dsps_fird_init_f32.c.
References coeffs, fir_f32_s::coeffs, fir_f32_s::decim, delay, fir_f32_s::delay, ESP_ERR_DSP_ARRAY_NOT_ALIGNED, ESP_ERR_DSP_INVALID_LENGTH, ESP_OK, fir_f32_s::N, N, and fir_f32_s::pos.
| esp_err_t dsps_fird_init_s16 | ( | fir_s16_t * | fir, |
| int16_t * | coeffs, | ||
| int16_t * | delay, | ||
| int16_t | coeffs_len, | ||
| int16_t | decim, | ||
| int16_t | start_pos, | ||
| int16_t | shift ) |
initialize structure for 16 bit Decimation FIR filter Function initialize structure for 16 bit signed fixed point FIR filter with decimation The implementation use ANSI C and could be compiled and run on any platform
| fir | pointer to fir filter structure, that must be preallocated |
| coeffs | array with FIR filter coefficients. Must be length N |
| delay | array for FIR filter delay line. Must be length N |
| coeffs_len | FIR filter length. Length of coeffs and delay arrays. |
| decim | decimation factor. |
| start_pos | initial value of decimation counter. Must be [0..d) |
| shift | shift position of the result |
Definition at line 14 of file dsps_fird_init_s16.c.
References coeffs, fir_s16_s::coeffs, fir_s16_s::coeffs_len, fir_s16_s::d_pos, fir_s16_s::decim, delay, fir_s16_s::delay, ESP_ERR_DSP_ARRAY_NOT_ALIGNED, ESP_ERR_DSP_INVALID_LENGTH, ESP_ERR_DSP_PARAM_OUTOFRANGE, ESP_OK, fir_s16_s::free_status, memalign, fir_s16_s::pos, fir_s16_s::rounding_buff, fir_s16_s::rounding_val, ROUNDING_VALUE, and fir_s16_s::shift.
| int32_t dsps_fird_s16_ae32 | ( | fir_s16_t * | fir, |
| const int16_t * | input, | ||
| int16_t * | output, | ||
| int32_t | len ) |
| int32_t dsps_fird_s16_aes3 | ( | fir_s16_t * | fir, |
| const int16_t * | input, | ||
| int16_t * | output, | ||
| int32_t | len ) |
support arrays freeing function
Function frees all the arrays, which were created during the initialization of the fir_s16_t structure
| fir | pointer to fir filter structure, that must be initialized before |
Definition at line 119 of file dsps_fird_init_s16.c.
References fir_s16_s::coeffs, fir_s16_s::delay, ESP_OK, fir_s16_s::free_status, and fir_s16_s::rounding_buff.
Referenced by dsps_resampler_mr_free().
| int32_t dsps_fird_s16_ansi | ( | fir_s16_t * | fir, |
| const int16_t * | input, | ||
| int16_t * | output, | ||
| int32_t | len ) |
16 bit signed fixed point Decimation FIR filter
Function implements FIR filter with decimation The extension (_ansi) uses ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.
| fir | pointer to fir filter structure, that must be initialized before |
| input | input array |
| output | array with the result of the FIR filter |
| len | length of the result array |
Definition at line 9 of file dsps_fird_s16_ansi.c.
References fir_s16_s::coeffs, fir_s16_s::coeffs_len, fir_s16_s::d_pos, fir_s16_s::decim, fir_s16_s::delay, n, fir_s16_s::pos, fir_s16_s::rounding_val, and fir_s16_s::shift.
| int32_t dsps_fird_s16_arp4 | ( | fir_s16_t * | fir, |
| const int16_t * | input, | ||
| int16_t * | output, | ||
| int32_t | len ) |
| int dsps_firmr_f32_ansi | ( | fir_f32_t * | fir, |
| const float * | input, | ||
| float * | output, | ||
| int | input_len ) |
32 bit floating point multi-rate FIR filter
Function implements FIR filter with decimation The extension (_ansi) uses ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.
| fir | pointer to fir filter structure, that must be initialized before |
| input | input array |
| output | array with the result of the FIR filter |
| input_len | length of the input array |
Definition at line 14 of file dsps_firmr_f32_ansi.c.
References fir_f32_s::coeffs, fir_f32_s::decim, fir_f32_s::delay, fir_f32_s::delay_size, fir_f32_s::interp, m, n, fir_f32_s::pos, and fir_f32_s::start_pos.
| esp_err_t dsps_firmr_init_f32 | ( | fir_f32_t * | fir, |
| float * | coeffs, | ||
| float * | delay, | ||
| int | length, | ||
| int | interp, | ||
| int | decim, | ||
| int | start_pos ) |
initialize structure for multi-rate FIR filter Function initialize structure for 32 bit floating point multi-rate FIR filter The implementation use ANSI C and could be compiled and run on any platform
| fir | pointer to fir filter structure, that must be preallocated |
| coeffs | array with FIR filter coefficients. Must be length N |
| delay | array for FIR filter delay line. Must be length N |
| length | FIR filter length. Length of coeffs and delay arrays. |
| interp | interpolation factor. |
| decim | decimation factor. |
| start_pos | initial value of decimation counter. Must be [0..decim) |
Definition at line 12 of file dsps_firmr_init_f32.c.
References coeffs, fir_f32_s::coeffs, fir_f32_s::decim, delay, fir_f32_s::delay, fir_f32_s::delay_size, ESP_ERR_DSP_ARRAY_NOT_ALIGNED, ESP_ERR_DSP_INVALID_LENGTH, ESP_ERR_DSP_INVALID_PARAM, ESP_OK, fir_f32_s::interp, fir_f32_s::interp_pos, memalign, fir_f32_s::N, fir_f32_s::pos, fir_f32_s::start_pos, and fir_f32_s::use_delay.
Referenced by dsps_resampler_mr_init().
| esp_err_t dsps_firmr_init_s16 | ( | fir_s16_t * | fir, |
| int16_t * | coeffs, | ||
| int16_t * | delay, | ||
| int16_t | length, | ||
| int16_t | interp, | ||
| int16_t | decim, | ||
| int16_t | start_pos, | ||
| int16_t | shift ) |
initialize structure for multi-rate FIR filter Function initialize structure for 16 bit signed fixed point multi-rate FIR filter The implementation use ANSI C and could be compiled and run on any platform
| fir | pointer to fir filter structure, that must be preallocated |
| coeffs | array with FIR filter coefficients. Must be length N |
| delay | array for FIR filter delay line. Must be length N |
| length | FIR filter length. Length of coeffs and delay arrays. |
| interp | interpolation factor. |
| decim | decimation factor. |
| start_pos | initial value of decimation counter. Must be [0..decim) |
| shift | shift of accumulator value to store in the output array. |
Definition at line 15 of file dsps_firmr_init_s16.c.
References coeffs, fir_s16_s::coeffs, fir_s16_s::coeffs_len, fir_s16_s::d_pos, fir_s16_s::decim, delay, fir_s16_s::delay, fir_s16_s::delay_size, ESP_ERR_DSP_INVALID_LENGTH, ESP_ERR_DSP_PARAM_OUTOFRANGE, ESP_OK, fir_s16_s::free_status, fir_s16_s::interp, fir_s16_s::interp_pos, memalign, fir_s16_s::pos, fir_s16_s::rounding_val, ROUNDING_VALUE, fir_s16_s::shift, and fir_s16_s::start_pos.
Referenced by dsps_resampler_mr_init().
| int32_t dsps_firmr_s16_ansi | ( | fir_s16_t * | fir, |
| const int16_t * | input, | ||
| int16_t * | output, | ||
| int32_t | input_len ) |
16 bit signed fixed point multi-rate FIR filter
Function implements FIR filter with decimation The extension (_ansi) uses ANSI C and could be compiled and run on any platform. The extension (_ae32) is optimized for ESP32 chip.
| fir | pointer to fir filter structure, that must be initialized before |
| input | input array |
| output | array with the result of the FIR filter |
| input_len | length of the intput array |
Definition at line 11 of file dsps_firmr_s16_ansi.c.
References fir_s16_s::coeffs, fir_s16_s::decim, fir_s16_s::delay, fir_s16_s::delay_size, fir_s16_s::interp, m, n, fir_s16_s::pos, fir_s16_s::rounding_val, fir_s16_s::shift, and fir_s16_s::start_pos.