|
ESP-IDF Firmware
Firmware architecture and call graph
|
Go to the source code of this file.
Functions | |
| esp_err_t | dsps_resampler_mr_init (dsps_resample_mr_t *resampler, void *coeffs, int16_t length, int16_t interp, float samplerate_factor, int32_t fixed_point, int16_t shift) |
| Initialize the multi-rate resampler. | |
| int32_t | dsps_resampler_mr_exec (dsps_resample_mr_t *resampler, void *input, void *output, int32_t length, int32_t length_correction) |
| Execute the multi-rate resampler. | |
| void | dsps_resampler_mr_free (dsps_resample_mr_t *resampler) |
| Free the multi-rate resampler. | |
Variables | |
| static const float | decim_avg_coeff = 0.9999 |
| int32_t dsps_resampler_mr_exec | ( | dsps_resample_mr_t * | resampler, |
| void * | input, | ||
| void * | output, | ||
| int32_t | length, | ||
| int32_t | length_correction ) |
Execute the multi-rate resampler.
This function executes the multi-rate resampler. The input and output buffers can be the same. The function based on multi-rate FIR filter. The decimation factor is updated for each execution. The current decimation factor calculated as division of average input and average output sample rate. To correct the output sample rate, the length_correction parameter is used. To increase the output sample rate, the length_correction parameter should be positive. To decrease the output sample rate, the length_correction parameter should be negative. This parameter is used when the input and output sample rates are comes from different sources.
| resampler | Pointer to the resampler structure |
| input | Pointer to the input buffer |
| output | Pointer to the output buffer |
| length | Length of the input buffers |
| length_correction | Length correction for the current execution. Positive value increases the output sample rate, negative value decreases the output sample rate. |
Definition at line 47 of file dsps_resampler_mr.c.
References dsps_resample_mr_s::active_decim, decim_avg_coeff, dsps_resample_mr_s::decim_avg_in, dsps_resample_mr_s::decim_avg_out, dsps_resample_mr_s::decim_c, dsps_resample_mr_s::decim_f, dsps_resample_mr_s::dsps_firmr, dsps_resample_mr_s::filter, dsps_resample_mr_s::fixed_point, and dsps_resample_mr_s::samplerate_factor.
| void dsps_resampler_mr_free | ( | dsps_resample_mr_t * | resampler | ) |
Free the multi-rate resampler.
| resampler | Pointer to the resampler structure |
Definition at line 70 of file dsps_resampler_mr.c.
References dsps_fir_f32_free(), dsps_fird_s16_aexx_free(), dsps_resample_mr_s::filter, and dsps_resample_mr_s::fixed_point.
| esp_err_t dsps_resampler_mr_init | ( | dsps_resample_mr_t * | resampler, |
| void * | coeffs, | ||
| int16_t | length, | ||
| int16_t | interp, | ||
| float | samplerate_factor, | ||
| int32_t | fixed_point, | ||
| int16_t | shift ) |
Initialize the multi-rate resampler.
| resampler | Pointer to the resampler structure |
| coeffs | Pointer to the filter coefficients (float or int16_t for fixed point) |
| length | Length of the filter coefficients |
| interp | Interpolation factor for the filter |
| samplerate_factor | Sample rate factor |
| fixed_point | Fixed point flag, 0 for float, 1 for fixed point |
| shift | Shift value for fixed point |
Definition at line 12 of file dsps_resampler_mr.c.
References dsps_resample_mr_s::active_decim, coeffs, dsps_resample_mr_s::decim_avg_in, dsps_resample_mr_s::decim_avg_out, dsps_resample_mr_s::decim_c, dsps_resample_mr_s::decim_f, dsps_resample_mr_s::dsps_firmr, dsps_firmr_f32, dsps_firmr_init_f32(), dsps_firmr_init_s16(), dsps_firmr_s16, ESP_ERR_DSP_INVALID_PARAM, ESP_OK, dsps_resample_mr_s::filter, dsps_resample_mr_s::fixed_point, and dsps_resample_mr_s::samplerate_factor.
|
static |
Definition at line 10 of file dsps_resampler_mr.c.
Referenced by dsps_resampler_mr_exec().