Developer World
Spresense SDK Library v3.3.0-375c679
Functions
Collaboration diagram for Functions:

Functions

int fir_calc_tapnumber (int fs, int tr_width)
 
fir_instancef_t * fir_create_lpff (int fs, int cutoff_freq, int tr_width, int blocksz)
 
fir_instancef_t * fir_create_lpff_tap (int fs, int cutoff_freq, int taps, int blocksz)
 
fir_instancef_t * fir_create_hpff (int fs, int cutoff_freq, int tr_width, int blocksz)
 
fir_instancef_t * fir_create_hpff_tap (int fs, int cutoff_freq, int taps, int blocksz)
 
fir_instancef_t * fir_create_bpff (int fs, int lower_cutfreq, int higher_cutfreq, int tr_width, int blocksz)
 
fir_instancef_t * fir_create_bpff_tap (int fs, int lower_cutfreq, int higher_cutfreq, int taps, int blocksz)
 
fir_instancef_t * fir_create_beff (int fs, int lower_cutfreq, int higher_cutfreq, int tr_width, int blocksz)
 
fir_instancef_t * fir_create_beff_tap (int fs, int lower_cutfreq, int higher_cutfreq, int taps, int blocksz)
 
int fir_get_tapnumf (fir_instancef_t *fir)
 
void fir_executef (fir_instancef_t *fir, float *input, float *output, int len)
 
void firabs_executef (fir_instancef_t *fir, float *input, float *output, int len)
 
void fir_deletef (fir_instancef_t *fir)
 

Detailed Description

Function Documentation

◆ fir_calc_tapnumber()

int fir_calc_tapnumber ( int  fs,
int  tr_width 
)

Calculate FIR tap number from sampling frequency and transition band width

Parameters
[in]fsSampling rate of target signals.
[in]tr_widthTransition frequency band width. (Hz)
Returns
tap number for the transision band width.

◆ fir_create_lpff()

fir_instancef_t * fir_create_lpff ( int  fs,
int  cutoff_freq,
int  tr_width,
int  blocksz 
)

Create FIR Low Pass Filter coefficients

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tr_widthTransition frequency band width. (Hz)
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_lpff_tap()

fir_instancef_t * fir_create_lpff_tap ( int  fs,
int  cutoff_freq,
int  taps,
int  blocksz 
)

Create FIR Low Pass Filter coefficients with Tap size

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tapsTap size
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_hpff()

fir_instancef_t * fir_create_hpff ( int  fs,
int  cutoff_freq,
int  tr_width,
int  blocksz 
)

Create FIR High Pass Filter coefficients

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tr_widthTransition frequency band width. (Hz)
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_hpff_tap()

fir_instancef_t * fir_create_hpff_tap ( int  fs,
int  cutoff_freq,
int  taps,
int  blocksz 
)

Create FIR High Pass Filter coefficients with Tap size

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tapsTap size
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_bpff()

fir_instancef_t * fir_create_bpff ( int  fs,
int  lower_cutfreq,
int  higher_cutfreq,
int  tr_width,
int  blocksz 
)

Create FIR Band Pass Filter coefficients

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tr_widthTransition frequency band width. (Hz)
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_bpff_tap()

fir_instancef_t * fir_create_bpff_tap ( int  fs,
int  lower_cutfreq,
int  higher_cutfreq,
int  taps,
int  blocksz 
)

Create FIR Band Pass Filter coefficients with Tap size

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tapsTap size
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_beff()

fir_instancef_t * fir_create_beff ( int  fs,
int  lower_cutfreq,
int  higher_cutfreq,
int  tr_width,
int  blocksz 
)

Create FIR Band Elimination Filter coefficients

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tr_widthTransition frequency band width. (Hz)
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_create_beff_tap()

fir_instancef_t * fir_create_beff_tap ( int  fs,
int  lower_cutfreq,
int  higher_cutfreq,
int  taps,
int  blocksz 
)

Create FIR Band Elimination Filter coefficients with Tap size

Parameters
[in]fsSampling rate of target signals.
[in]cuttoff_freqCut off frequency. (Hz)
[in]tapsTap size
[in]blockszBlock size to execute filter calcuation in one time. (samples)
Returns
fir_instancef_t instance is returned on success, otherwise returns NULL.
Note
This function allocate memory for instance of fir_instancef_t, so you free when you finished to use the filter by fir_delete().

◆ fir_get_tapnumf()

int fir_get_tapnumf ( fir_instancef_t *  fir)

Get tap number of created FIR filter instance

Parameters
[in]firTarget instance of fir_instancef_t to get tap number from.
Returns
Tap number.

◆ fir_executef()

void fir_executef ( fir_instancef_t *  fir,
float *  input,
float *  output,
int  len 
)

Execute FIR filter

Parameters
[in]firInstance of fir_instancef_t.
[in]inputfloat array of input data.
[out]outputfloat array of output data.
[in]lenLength of arrays. This size must be multiple of blocksz set by fir_create_xxx().

◆ firabs_executef()

void firabs_executef ( fir_instancef_t *  fir,
float *  input,
float *  output,
int  len 
)

Execute FIR filter and calculate the avsolute value

Parameters
[in]firInstance of fir_instancef_t.
[in]inputfloat array of input data.
[out]outputfloat array of output data.
[in]lenLength of arrays. This size must be multiple of blocksz set by fir_create_xxx().

◆ fir_deletef()

void fir_deletef ( fir_instancef_t *  fir)

Delete FIR instance

Parameters
[in]firInstance of fir_instancef_t.