Following is a brief description of the frequency re-sampling algorithm used in this module. It is aimed for anybody so no specifics digital signal processing knowledges are required to understand this presentation.
Frequency response from 32KHz to 44.1KHz
Frequency response from 48KHz to 48.51KHz
Data Structures | |
struct | dsp_resampling_context_t |
This structure is used to store the context of streaming information during resampling process. More... | |
struct | dsp_resampling_t |
This structure is used to store the context of a resampling process. More... | |
Resampling setup function | |
enum | dsp_resampling_options_t { DSP_RESAMPLING_OPTIONS_NONE, DSP_RESAMPLING_OPTIONS_NORMALIZE_FILTER_COEFFICIENTS } |
Options to attribute to the resampling algorithm. More... | |
typedef void *(* | malloc_fct_t )(int) |
A pointer on a memory allocation function. | |
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) |
This function is the 16-bit signal resampling setup function. It has to be called only once at the initialization of the resampling process. | |
Resampling setup function | |
typedef void(* | free_fct_t )(void *) |
A pointer on a memory free function. | |
void | dsp16_resampling_free (dsp_resampling_t *dsp_resampling, free_fct_t free_fct) |
Function used to free the previously allocted structure issued by the dsp16_resampling_setup function. | |
Functions | |
void | dsp16_resampling_compute (dsp_resampling_t *dsp_resampling, dsp16_t *output, dsp16_t *input, int channel) |
The re-sampling computation function. | |
int | dsp16_resampling_get_output_current_buffer_size (dsp_resampling_t *dsp_resampling) |
Returns the current length in sample of the output signal. | |
int | dsp16_resampling_get_output_max_buffer_size (dsp_resampling_t *dsp_resampling) |
Returns the maximal length in sample of the output signal. | |
bool | dsp16_resampling_link (dsp_resampling_t *dsp_resampling_output, dsp_resampling_t *dsp_resampling_input) |
Link a stream previously re-sampled using the dsp_resampling_input resampling structure with the new re-sampling structure dsp_resampling_output. This is used to keep the continuity with two pieces of a stream re-sampled using two different re-sampling parameters. |
typedef void(* free_fct_t)(void *) |
typedef void*(* malloc_fct_t)(int) |
Options to attribute to the resampling algorithm.
DSP_RESAMPLING_OPTIONS_NONE | No specific options. |
DSP_RESAMPLING_OPTIONS_NORMALIZE_FILTER_COEFFICIENTS | Normalize the filter coefficients to ensure the output won't be too reduced. |
Definition at line 171 of file dsp_resampling.h.
00172 { 00174 DSP_RESAMPLING_OPTIONS_NONE, 00176 DSP_RESAMPLING_OPTIONS_NORMALIZE_FILTER_COEFFICIENTS 00177 } dsp_resampling_options_t;
void dsp16_resampling_compute | ( | dsp_resampling_t * | dsp_resampling, | |
dsp16_t * | output, | |||
dsp16_t * | input, | |||
int | channel | |||
) |
The re-sampling computation function.
dsp_resampling | The re-sampling context structure associated. | |
output | A pointer on a 16-bit vector used to store output data. The length of this vector is defined by the output of the dsp16_resampling_get_output_current_buffer_size function. | |
input | A pointer on a 16-bit vector used as an input to the re-sampling process. It has to be of a length defined to the dsp16_resampling_setup function as for its sampling rate. | |
channel | The channel number to compute (starting from 0 to nb_channels - 1 refered in dsp16_resampling_setup). |
void dsp16_resampling_free | ( | dsp_resampling_t * | dsp_resampling, | |
free_fct_t | free_fct | |||
) |
Function used to free the previously allocted structure issued by the dsp16_resampling_setup function.
dsp_resampling | The re-sampling context structure to be freed. | |
free_fct | A pointer on the free function to be used. |
int dsp16_resampling_get_output_current_buffer_size | ( | dsp_resampling_t * | dsp_resampling | ) |
Returns the current length in sample of the output signal.
dsp_resampling | The re-sampling context structure associated. |
int dsp16_resampling_get_output_max_buffer_size | ( | dsp_resampling_t * | dsp_resampling | ) |
Returns the maximal length in sample of the output signal.
dsp_resampling | The re-sampling context structure associated. |
bool dsp16_resampling_link | ( | dsp_resampling_t * | dsp_resampling_output, | |
dsp_resampling_t * | dsp_resampling_input | |||
) |
Link a stream previously re-sampled using the dsp_resampling_input resampling structure with the new re-sampling structure dsp_resampling_output. This is used to keep the continuity with two pieces of a stream re-sampled using two different re-sampling parameters.
dsp_resampling_output | The re-sampling context which will be updated according to the dsp_resampling_input context. | |
dsp_resampling_input | The input re-sampling context. |
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 | |||
) |
This function is the 16-bit signal resampling setup function. It has to be called only once at the initialization of the resampling process.
input_sample_rate | The sample rate of the input signal. | |
output_sample_rate | The sample rate of the output signal. | |
buffer_size | The size of the input buffers. | |
filter_order | The order of the filter to be used. | |
malloc_fct | A pointer on a memory allocation function. | |
nb_channels | The number of channels to compute. | |
options | Add specific options to the algorithm. |