00001
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef __DSP_RESAMPLING_H__
00046 #define __DSP_RESAMPLING_H__
00047
00048 #ifdef __AVR32_ABI_COMPILER__
00049
00050 #include "dsp.h"
00051
00127 typedef struct
00128 {
00130 int input_buffer_pos;
00132 int index;
00133 } dsp_resampling_context_t;
00137 typedef struct
00138 {
00140 int fs;
00142 int interpolation_factor;
00144 int decimation_factor;
00146 void *last_samples;
00148 int buffer_size;
00150 void *fir_coefs;
00154 int filter_order;
00156 int current_buffer_size;
00158 int nb_channels;
00160 bool link_required;
00162 dsp_resampling_context_t *context;
00163 } dsp_resampling_t;
00164
00167
00168
00171 typedef enum
00172 {
00174 DSP_RESAMPLING_OPTIONS_NONE,
00176 DSP_RESAMPLING_OPTIONS_NORMALIZE_FILTER_COEFFICIENTS
00177 } dsp_resampling_options_t;
00181 typedef void *(*malloc_fct_t)(int);
00197 dsp_resampling_t *dsp16_resampling_setup(int input_sample_rate, int output_sample_rate, int buffer_size, int filter_order, int nb_channels, malloc_fct_t malloc_fct, dsp_resampling_options_t options);
00199
00202
00203
00206 typedef void (*free_fct_t)(void *);
00213 void dsp16_resampling_free(dsp_resampling_t *dsp_resampling, free_fct_t free_fct);
00215
00220 int dsp16_resampling_get_output_max_buffer_size(dsp_resampling_t *dsp_resampling);
00221
00226 int dsp16_resampling_get_output_current_buffer_size(dsp_resampling_t *dsp_resampling);
00227
00240 void dsp16_resampling_compute(dsp_resampling_t *dsp_resampling, dsp16_t *output, dsp16_t *input, int channel);
00241
00258 bool dsp16_resampling_link(dsp_resampling_t *dsp_resampling_output, dsp_resampling_t *dsp_resampling_input);
00259
00260 #endif // __AVR32_ABI_COMPILER__
00261 #endif //__DSP_RESAMPLING_H__