Microchip® Advanced Software Framework

dsp.h File Reference
#include "compiler.h"
#include "preprocessor.h"
#include "string.h"
#include "dsp.h"

Data Structures

struct  dsp16_complex_t
 16-bit complex signed fixed point type More...
 
struct  dsp16_resampling_options_t
 Options to attribute to the resampling algorithm. More...
 
struct  dsp32_complex_t
 32-bit complex signed fixed point type More...
 
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...
 

Macros

#define __ADPCM_H__
 
#define __DSP_FILTERING_H__
 
#define __DSP_OPERATORS_H__
 
#define __DSP_RESAMPLING_H__
 
#define __DSP_SIGNAL_GENERATION_H__
 
#define __DSP_TRANSFORMS_H__
 
#define __DSP_VECTORS_H__
 
#define __DSP_WINDOWING_H__
 
#define A_ALIGNED   __attribute__ ((aligned(4)))
 Alignment attribute on 4 bytes for 32-bit or lower microcontroller optimization for GCC compiler. More...
 
#define A_PACKED   __attribute__ ((__packed__))
 Packed data attribute for GCC compiler. More...
 
#define CST_E   2.718281828459045235360287471352662497757
 E definition also known as the natural logarithmic base. More...
 
#define CST_INV_SQUARE_ROOT_2   0.70710678118654752440084436210485
 1/sqrt(2) definition More...
 
#define CST_LN_10   2.3025850929940456840179914546844
 ln(10) definition More...
 
#define CST_LN_2   0.69314718055994530941723212145818
 ln(2) definition More...
 
#define CST_PI   3.141592653589793238462643383279502884197
 PI definition also known as the Archimedes' constant. More...
 
#define CST_SQUARE_ROOT_2   1.4142135623730950488016887242097
 sqrt(2) definition More...
 
#define DSP16_PI_DIV_4   DSP16_Q(CST_PI/4.)
 PI/4 definition for the 16-bit fixed point type. More...
 
#define dsp16_t__   int16_t
 16-bit signed fixed point type More...
 
#define DSP32_PI_DIV_4   DSP32_Q(CST_PI/4.)
 PI/4 definition for the 32-bit fixed point type. More...
 
#define dsp32_t__   int32_t
 32-bit signed fixed point type More...
 
Q Format definition for the 16-bit type
Note
The 16-bit functions are optimized to work with a Q1.15 format:
Resolution: 0.00003
Range: [-1.; 0.99997]
#define DSP16_QA   1
 number of integer bits More...
 
#define DSP16_QB   15
 number of fractional bits More...
 
Q Format definition for the 32-bit type
Note
The 32-bit functions are optimized to work with a Q1.31 format:
Resolution: 0.00000000047
Range: [-1.; 0.99999999953]
#define DSP32_QA   1
 number of integer bits More...
 
#define DSP32_QB   31
 number of fractional bits More...
 
Limit values in floating-point format of a signed fixed-point number typed Qa.b
#define DSP_FP_MAX(a, b)   (((float) (1 << ((a)-1))) - DSP_FP_RES(a, b))
 Return the maximal value of a fixed-point Qa.b typed number. The result is returned as a floating point number. More...
 
#define DSP_FP_MIN(a, b)   (-((float) (1 << ((a)-1))))
 Return the minimal value of a fixed-point Qa.b typed number. The result is returned as a floating point number. More...
 
Limit values in fixed-point format of a signed fixed-point number typed Qa.b
#define DSP_Q_MAX(a, b)   ((int32_t) (((uint32_t) -1) >> (32 - ((a)+(b)-1))))
 Return the maximal value of a fixed-point Qa.b typed number. More...
 
#define DSP_Q_MIN(a, b)   ((int32_t) ((-1) << ((a)+(b)-1)))
 Return the minimal value of a fixed-point Qa.b typed number. More...
 
Resolution in floating-point format of a signed fixed-point number typed Qa.b
#define DSP_FP_RES(a, b)   (1./((unsigned) (1 << (b))))
 Return the resolution of a fixed-point Qa.b typed number. More...
 
Conversion macro from a float to a Q Formated value
Note
These macros limit the number in its range
#define DSP_Q(a, b, fnum)
 Convert a float into a signed fixed-point typed Qa.b. More...
 
#define DSP16_Q(fnum)   ((dsp16_t__) DSP_Q(DSP16_QA, DSP16_QB, fnum))
 Convert a float into a 16-bit signed fixed-point type. More...
 
#define DSP32_Q(fnum)   ((dsp32_t__) DSP_Q(DSP32_QA, DSP32_QB, fnum))
 Convert a float into a 32-bit signed fixed-point type. More...
 

Typedefs

typedef struct A_PACKED
dsp16_complex_t 
dsp16_complex_t
 16-bit complex signed fixed point type More...
 
typedef dsp16_t__ dsp16_t
 16-bit signed fixed point type optimized for 32-bit or lower microcontrollers More...
 
typedef struct A_PACKED
dsp32_complex_t 
dsp32_complex_t
 32-bit complex signed fixed point type More...
 
typedef dsp32_t__ dsp32_t
 32-bit signed fixed point type optimized for 32-bit or lower microcontrollers More...
 

Functions

static void dsp16_filt_fir (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t *h, int h_size)
 16 bits fixed point version of the FIR . More...
 
void dsp16_filt_iir (dsp16_t *y, dsp16_t *x, int size, dsp16_t *num, int num_size, dsp16_t *den, int den_size, int num_prediv, int den_prediv)
 16-bit fixed point version of the IIR . More...
 
void dsp16_filt_iirpart (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t *num, int num_size, dsp16_t *den, int den_size, int num_prediv, int den_prediv)
 16 bits fixed point version of the IIR . More...
 
void dsp16_filt_interpolation (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *h, int h_size, int interpolation_ratio)
 This function interpolates a vector. More...
 
void dsp16_filt_interpolation_coefsort (dsp16_t *fir_coefs, int n_tap, int interpolation_ratio)
 This function resort the coefficients of a FIR filter to be used with the function dsp16_filt_interpolation. More...
 
void dsp16_filt_lms (dsp16_t *x, dsp16_t *w, int size, dsp16_t new_x, dsp16_t d, dsp16_t *y, dsp16_t *e)
 16-bit fixed point version of the LMS filter. More...
 
void dsp16_filt_lpfirdesign (dsp16_t *c, int fc, int fs, int order)
 16-bit fixed point version of the low-pass FIR filter design. More...
 
void dsp16_filt_lpfirdesign_windowed_sinc (dsp16_t *c, int fc_hz, int fs_hz, int order)
 16-bit fixed point version of the windowed sinc low-pass FIR filter design. More...
 
void dsp16_filt_nlms (dsp16_t *x, dsp16_t *w, int size, dsp16_t new_x, dsp16_t d, dsp16_t *y, dsp16_t *e)
 16-bit fixed point version of the NLMS filter. More...
 
dsp16_t dsp16_gen_cos (dsp16_t *vect1, int size, int f, int fs, dsp16_t phase)
 16-bit fixed point version of the cosinusoidal signal generation. More...
 
void dsp16_gen_dcomb (dsp16_t *vect1, int size, int f, int fs, dsp16_t delay)
 16-bit fixed point version of the dirac comb signal generation. More...
 
void dsp16_gen_dirac (dsp16_t *vect1, int size, int dirac_index)
 16-bit fixed point version of the dirac comb signal generation. More...
 
void dsp16_gen_noise (dsp16_t *vect1, int size, dsp16_t amp)
 16-bit fixed point version of the noise generation. More...
 
void dsp16_gen_ramp (dsp16_t *vect1, int size, dsp16_t increment)
 16-bit fixed point version of the ramp signal generation. More...
 
void dsp16_gen_rect (dsp16_t *vect1, int size, int f, int fs, dsp16_t duty, dsp16_t delay)
 16-bit fixed point version of the rectangular signal generation. More...
 
dsp16_t dsp16_gen_saw (dsp16_t *vect1, int size, int f, int fs, dsp16_t duty, dsp16_t delay)
 16-bit fixed point version of the saw tooth signal generation. More...
 
dsp16_t dsp16_gen_sin (dsp16_t *vect1, int size, int f, int fs, dsp16_t phase)
 16-bit fixed point version of the sinusoidal signal generation. More...
 
static void dsp16_gen_sqr (dsp16_t *vect1, int size, int f, int fs, dsp16_t delay)
 16-bit fixed point version of the square signal generation. More...
 
void dsp16_gen_step (dsp16_t *vect1, int size, dsp16_t intial_value, dsp16_t final_value, int step_index)
 16-bit fixed point version of the dirac comb signal generation. More...
 
static dsp16_t dsp16_op_abs (dsp16_t number)
 16-bit fixed point version of the absolute function. More...
 
static dsp16_t dsp16_op_acos (dsp16_t number)
 16-bit fixed point version of the arc cosine function. More...
 
dsp16_t dsp16_op_asin (dsp16_t number)
 16-bit fixed point version of the arc sine function. More...
 
static dsp16_t dsp16_op_cos (dsp16_t angle)
 16-bit fixed point version of the cosine function. More...
 
static dsp16_t dsp16_op_div (dsp16_t num, dsp16_t den)
 16-bit fixed point version of the division function. More...
 
dsp16_t dsp16_op_exp (dsp16_t number)
 16-bit fixed point version of the exponential function. More...
 
dsp16_t dsp16_op_ln (dsp16_t number)
 16-bit fixed point version of the natural logarithm function. More...
 
dsp16_t dsp16_op_log10 (dsp16_t number)
 16-bit fixed point version of the common logarithm function. More...
 
dsp16_t dsp16_op_log2 (dsp16_t number)
 16-bit fixed point version of the binary logarithm function. More...
 
static dsp16_t dsp16_op_mul (dsp16_t num1, dsp16_t num2)
 16-bit fixed point version of the multiplication function. More...
 
dsp16_t dsp16_op_pow (dsp16_t x, dsp16_t y)
 16-bit fixed point version of the power function. More...
 
dsp16_t dsp16_op_rand (void)
 16-bit fixed point version of the random operator. More...
 
dsp16_t dsp16_op_sin (dsp16_t angle)
 16-bit fixed point version of the sine function. More...
 
dsp16_t dsp16_op_sqrt (dsp16_t number)
 16-bit fixed point version of the square root function. More...
 
void dsp16_resampling_compute (dsp_resampling_t *dsp_resampling, dsp16_t *output, dsp16_t *input, int channel)
 The re-sampling computation function. More...
 
int dsp16_resampling_get_output_current_buffer_size (dsp_resampling_t *dsp_resampling)
 Returns the current length in sample of the output signal. More...
 
int dsp16_resampling_get_output_max_buffer_size (dsp_resampling_t *dsp_resampling)
 Returns the maximal length in sample of the output signal. More...
 
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. More...
 
void dsp16_trans_complexfft (dsp16_complex_t *vect1, dsp16_complex_t *vect2, int nlog)
 16-bit fixed point version of the complex FFT algorithm. More...
 
void dsp16_trans_complexifft (dsp16_complex_t *vect1, dsp16_complex_t *vect2, int nlog)
 16-bit fixed point version of the complex iFFT algorithm. More...
 
void dsp16_trans_realcomplexfft (dsp16_complex_t *vect1, dsp16_t *vect2, int nlog)
 16-bit fixed point version of the real to complex FFT algorithm. More...
 
void dsp16_vect_add (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector addition function. More...
 
void dsp16_vect_add_and_sat (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector addition function. More...
 
void dsp16_vect_complex_abs (dsp16_t *vect1, dsp16_complex_t *vect2, int size)
 16-bit fixed point version of the complex vector absolute function. More...
 
void dsp16_vect_complex_add (dsp16_complex_t *vect1, dsp16_complex_t *vect2, dsp16_complex_t *vect3, int size)
 16-bit fixed point version of the complex vector addition function. More...
 
void dsp16_vect_complex_conj (dsp16_complex_t *vect1, dsp16_complex_t *vect2, int size)
 16-bit fixed point version of the complex vector conjugate function. More...
 
void dsp16_vect_complex_sub (dsp16_complex_t *vect1, dsp16_complex_t *vect2, dsp16_complex_t *vect3, int size)
 16-bit fixed point version of the complex vector subtraction function. More...
 
void dsp16_vect_conv (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *vect3, int vect3_size)
 16-bit fixed point version of the Convolution. More...
 
void dsp16_vect_convpart (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *vect3, int vect3_size)
 16-bit fixed point version of the Partial Convolution. More...
 
static void dsp16_vect_copy (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the copy function. More...
 
void dsp16_vect_dotdiv (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector dot division function. More...
 
void dsp16_vect_dotmul (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector dot multiplication function. More...
 
void dsp16_vect_intdiv (dsp16_t *vect1, dsp16_t *vect2, int size, int integer)
 16-bit fixed point version of the vector division with an integer. More...
 
void dsp16_vect_intmul (dsp16_t *vect1, dsp16_t *vect2, int size, int integer)
 16-bit fixed point version of the vector multiplication with an integer. More...
 
dsp16_t dsp16_vect_max (dsp16_t *vect1, int size)
 16-bit fixed point version of the vector maximum function. More...
 
dsp16_t dsp16_vect_min (dsp16_t *vect1, int size)
 16-bit fixed point version of the vector minimum function. More...
 
void dsp16_vect_neg (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the vector negate function. More...
 
void dsp16_vect_pow (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the power function. More...
 
void dsp16_vect_realadd (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector addition with a real number. More...
 
void dsp16_vect_realdiv (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector division with a real number. More...
 
void dsp16_vect_realmul (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector multiplication with a real number. More...
 
void dsp16_vect_realsub (dsp16_t *vect1, dsp16_t *vect2, int size, dsp16_t real)
 16-bit fixed point version of the vector subtraction with a real number. More...
 
void dsp16_vect_sub (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector subtraction function. More...
 
static void dsp16_vect_zeropad (dsp16_t *vect1, int size, int num_zero)
 16-bit fixed point version of the zero padding function. More...
 
void dsp16_win_bart (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the Bartlett windowing function. More...
 
void dsp16_win_black (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the Blackman windowing function. More...
 
void dsp16_win_gauss (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the Gaussian windowing function. More...
 
void dsp16_win_hamm (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the hamming windowing function. More...
 
void dsp16_win_hann (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the hann windowing function. More...
 
void dsp16_win_kaiser (dsp16_t *vect1, dsp16_t *vect2, int size, int alpha)
 16-bit fixed point version of the kaiser windowing function. More...
 
void dsp16_win_rect (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the rectangular windowing function. More...
 
void dsp16_win_welch (dsp16_t *vect1, dsp16_t *vect2, int size)
 16-bit fixed point version of the Welch windowing function. More...
 
static void dsp32_filt_fir (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t *h, int h_size)
 32 bits fixed point version of the FIR . More...
 
void dsp32_filt_iir (dsp32_t *y, dsp32_t *x, int size, dsp32_t *num, int num_size, dsp32_t *den, int den_size, int num_prediv, int den_prediv)
 32-bit fixed point version of the IIR . More...
 
void dsp32_filt_iirpart (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t *num, int num_size, dsp32_t *den, int den_size, int num_prediv, int den_prediv)
 32 bits fixed point version of the IIR . More...
 
void dsp32_filt_lms (dsp32_t *x, dsp32_t *w, int size, dsp32_t new_x, dsp32_t d, dsp32_t *y, dsp32_t *e)
 32-bit fixed point version of the LMS filter. More...
 
void dsp32_filt_lms_fir (dsp32_t *x, dsp32_t *w, int size, dsp32_t *y, int i)
 
void dsp32_filt_nlms (dsp32_t *x, dsp32_t *w, int size, dsp32_t new_x, dsp32_t d, dsp32_t *y, dsp32_t *e)
 32-bit fixed point version of the NLMS filter. More...
 
void dsp32_filt_nlms_fir (dsp32_t *x, dsp32_t *w, int size, dsp32_t *y, int i)
 
dsp32_t dsp32_gen_cos (dsp32_t *vect1, int size, int f, int fs, dsp32_t phase)
 32-bit fixed point version of the cosinusoidal signal generation. More...
 
void dsp32_gen_dcomb (dsp32_t *vect1, int size, int f, int fs, dsp32_t delay)
 32-bit fixed point version of the dirac comb signal generation. More...
 
void dsp32_gen_dirac (dsp32_t *vect1, int size, int dirac_index)
 32-bit fixed point version of the dirac comb signal generation. More...
 
void dsp32_gen_noise (dsp32_t *vect1, int size, dsp32_t amp)
 32-bit fixed point version of the noise generation. More...
 
void dsp32_gen_ramp (dsp32_t *vect1, int size, dsp32_t increment)
 32-bit fixed point version of the ramp signal generation. More...
 
void dsp32_gen_rect (dsp32_t *vect1, int size, int f, int fs, dsp32_t duty, dsp32_t delay)
 32-bit fixed point version of the rectangular signal generation. More...
 
dsp32_t dsp32_gen_saw (dsp32_t *vect1, int size, int f, int fs, dsp32_t duty, dsp32_t delay)
 32-bit fixed point version of the saw tooth signal generation. More...
 
dsp32_t dsp32_gen_sin (dsp32_t *vect1, int size, int f, int fs, dsp32_t phase)
 32-bit fixed point version of the sinusoidal signal generation. More...
 
static void dsp32_gen_sqr (dsp32_t *vect1, int size, int f, int fs, dsp32_t delay)
 32-bit fixed point version of the square signal generation. More...
 
void dsp32_gen_step (dsp32_t *vect1, int size, dsp32_t intial_value, dsp32_t final_value, int step_index)
 32-bit fixed point version of the dirac comb signal generation. More...
 
static dsp32_t dsp32_op_abs (dsp32_t number)
 32-bit fixed point version of the absolute function. More...
 
static dsp32_t dsp32_op_acos (dsp32_t number)
 32-bit fixed point version of the arc cosine function. More...
 
dsp32_t dsp32_op_asin (dsp32_t number)
 32-bit fixed point version of the arc sine function. More...
 
static dsp32_t dsp32_op_cos (dsp32_t angle)
 32-bit fixed point version of the cosine function. More...
 
static dsp32_t dsp32_op_div (dsp32_t num, dsp32_t den)
 32-bit fixed point version of the division function. More...
 
dsp32_t dsp32_op_exp (dsp32_t number)
 32-bit fixed point version of the exponential function. More...
 
dsp32_t dsp32_op_ln (dsp32_t number)
 32-bit fixed point version of the natural logarithm function. More...
 
dsp32_t dsp32_op_log10 (dsp32_t number)
 32-bit fixed point version of the common logarithm function. More...
 
dsp32_t dsp32_op_log2 (dsp32_t number)
 32-bit fixed point version of the binary logarithm function. More...
 
static dsp32_t dsp32_op_mul (dsp32_t num1, dsp32_t num2)
 32-bit fixed point version of the multiplication function. More...
 
dsp32_t dsp32_op_pow (dsp32_t x, dsp32_t y)
 32-bit fixed point version of the power function. More...
 
dsp32_t dsp32_op_rand (void)
 32-bit fixed point version of the random operator. More...
 
dsp32_t dsp32_op_sin (dsp32_t angle)
 32-bit fixed point version of the sine function. More...
 
dsp32_t dsp32_op_sqrt (dsp32_t number)
 32-bit fixed point version of the square root function. More...
 
void dsp32_trans_realcomplexfft (dsp32_complex_t *vect1, dsp32_t *vect2, int nlog)
 32-bit fixed point version of the real to complex FFT algorithm. More...
 
void dsp32_vect_add (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector addition function. More...
 
void dsp32_vect_add_and_sat (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector addition function. More...
 
void dsp32_vect_complex_abs (dsp32_t *vect1, dsp32_complex_t *vect2, int size)
 32-bit fixed point version of the complex vector absolute function. More...
 
void dsp32_vect_complex_add (dsp32_complex_t *vect1, dsp32_complex_t *vect2, dsp32_complex_t *vect3, int size)
 32-bit fixed point version of the complex vector addition function. More...
 
void dsp32_vect_complex_sub (dsp32_complex_t *vect1, dsp32_complex_t *vect2, dsp32_complex_t *vect3, int size)
 32-bit fixed point version of the complex vector subtraction function. More...
 
void dsp32_vect_conv (dsp32_t *vect1, dsp32_t *vect2, int vect2_size, dsp32_t *vect3, int vect3_size)
 32-bit fixed point version of the Convolution. More...
 
void dsp32_vect_convpart (dsp32_t *vect1, dsp32_t *vect2, int vect2_size, dsp32_t *vect3, int vect3_size)
 32-bit fixed point version of the Partial Convolution. More...
 
static void dsp32_vect_copy (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the copy function. More...
 
void dsp32_vect_dotdiv (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector dot division function. More...
 
void dsp32_vect_dotmul (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector dot multiplication function. More...
 
void dsp32_vect_intdiv (dsp32_t *vect1, dsp32_t *vect2, int size, int integer)
 32-bit fixed point version of the vector division with an integer. More...
 
void dsp32_vect_intmul (dsp32_t *vect1, dsp32_t *vect2, int size, int integer)
 32-bit fixed point version of the vector multiplication with an integer. More...
 
dsp32_t dsp32_vect_max (dsp32_t *vect1, int size)
 32-bit fixed point version of the vector maximum function. More...
 
dsp32_t dsp32_vect_min (dsp32_t *vect1, int size)
 32-bit fixed point version of the vector minimum function. More...
 
void dsp32_vect_neg (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the vector negate function. More...
 
void dsp32_vect_pow (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the power function. More...
 
void dsp32_vect_realadd (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector addition with a real number. More...
 
void dsp32_vect_realdiv (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector division with a real number. More...
 
void dsp32_vect_realmul (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector multiplication with a real number. More...
 
void dsp32_vect_realsub (dsp32_t *vect1, dsp32_t *vect2, int size, dsp32_t real)
 32-bit fixed point version of the vector subtraction with a real number. More...
 
void dsp32_vect_sub (dsp32_t *vect1, dsp32_t *vect2, dsp32_t *vect3, int size)
 32-bit fixed point version of the vector subtraction function. More...
 
static void dsp32_vect_zeropad (dsp32_t *vect1, int size, int num_zero)
 32-bit fixed point version of the zero padding function. More...
 
void dsp32_win_bart (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the Bartlett windowing function. More...
 
void dsp32_win_black (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the Blackman windowing function. More...
 
void dsp32_win_gauss (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the Gaussian windowing function. More...
 
void dsp32_win_hamm (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the hamming windowing function. More...
 
void dsp32_win_hann (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the hann windowing function. More...
 
void dsp32_win_kaiser (dsp32_t *vect1, dsp32_t *vect2, int size, int alpha)
 32-bit fixed point version of the kaiser windowing function. More...
 
void dsp32_win_rect (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the rectangular windowing function. More...
 
void dsp32_win_welch (dsp32_t *vect1, dsp32_t *vect2, int size)
 32-bit fixed point version of the Welch windowing function. More...
 
void dsp_adpcm_ima_decode (int16_t *out, void *in, int size, int16_t *step_index, int16_t *predicted_value)
 IMA/DVI ADPCM decoder. More...
 
int16_t dsp_adpcm_ima_decode_nibble (int8_t nibble, int16_t *step_index, int16_t *predicted_value)
 IMA/DVI ADPCM sample decoder. More...
 
void dsp_adpcm_ima_encode (void *out, int16_t *in, int size, int16_t *step_index, int16_t *predicted_value)
 IMA/DVI ADPCM encoder. More...
 
int8_t dsp_adpcm_ima_encode_nibble (int16_t nibble, int16_t *step_index, int16_t *predicted_value)
 IMA/DVI ADPCM sample encoder. More...
 
void dsp_op_srand (int new_seed)
 Initialize the pseudo-random number generator. More...
 

Resampling setup function

typedef void *(* malloc_fct_t )(int)
 A pointer on a memory allocation function. More...
 
typedef void(* free_fct_t )(void *)
 A pointer on a memory free function. More...
 
dsp_resampling_tdsp16_resampling_setup (int input_sample_rate, int output_sample_rate, int buffer_size, int order, int nb_channels, malloc_fct_t malloc_fct, dsp16_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. More...
 
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. More...
 

#define __ADPCM_H__
#define __DSP_FILTERING_H__
#define __DSP_OPERATORS_H__
#define __DSP_RESAMPLING_H__
#define __DSP_SIGNAL_GENERATION_H__
#define __DSP_TRANSFORMS_H__
#define __DSP_VECTORS_H__
#define __DSP_WINDOWING_H__
#define A_ALIGNED   __attribute__ ((aligned(4)))

Alignment attribute on 4 bytes for 32-bit or lower microcontroller optimization for GCC compiler.

#define A_PACKED   __attribute__ ((__packed__))

Packed data attribute for GCC compiler.

void dsp32_filt_lms_fir ( dsp32_t x,
dsp32_t w,
int  size,
dsp32_t y,
int  i 
)
void dsp32_filt_nlms_fir ( dsp32_t x,
dsp32_t w,
int  size,
dsp32_t y,
int  i 
)