ESP-IDF Firmware
Firmware architecture and call graph
Loading...
Searching...
No Matches
dsps_resampler.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef _dsps_resampl_H_
8#define _dsps_resampl_H_
9
10#include "dsp_err.h"
11#include "dsps_fir.h"
12
13#ifdef __cplusplus
14extern "C"
15{
16#endif
17
27typedef struct dsps_resample_mr_s {
28 void *filter;
30 int16_t decim_c;
31 int16_t decim_f;
32 int16_t active_decim;
35 int32_t (*dsps_firmr)(void *fir, void *input, void *output, int32_t length);
36 int32_t fixed_point;
38
49typedef struct dsps_resample_ph_s {
50 float phase;
51 float step;
52 float delay[4];
55
69esp_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);
70
93int32_t dsps_resampler_mr_exec(dsps_resample_mr_t *resampler, void *input, void *output, int32_t length, int32_t length_correction);
94
101
102
103
115esp_err_t dsps_resampler_ph_init(dsps_resample_ph_t *resampler, float samplerate_factor);
116
127
128int32_t dsps_resampler_ph_exec(dsps_resample_ph_t *resampler, float *input, float *output, int32_t length);
129
130#ifdef __cplusplus
131}
132#endif
133#endif //_dsps_resampl_H_
esp_err_t dsps_resampler_ph_init(dsps_resample_ph_t *resampler, float samplerate_factor)
Initialize the poly-phase resampler.
void dsps_resampler_mr_free(dsps_resample_mr_t *resampler)
Free the multi-rate resampler.
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.
struct dsps_resample_ph_s dsps_resample_ph_t
Data struct of f32 poly-phase resampler.
struct dsps_resample_mr_s dsps_resample_mr_t
Data struct of f32 multi-rate resampler.
int32_t dsps_resampler_ph_exec(dsps_resample_ph_t *resampler, float *input, float *output, int32_t length)
Execute the poly-phase resampler.
int esp_err_t
Definition esp_err.h:21
Data struct of f32 multi-rate resampler.
int32_t(* dsps_firmr)(void *fir, void *input, void *output, int32_t length)
Data struct of f32 poly-phase resampler.
float coeffs[256]
Definition test_fir.c:14