Sound Open Firmware
Loading...
Searching...
No Matches
iir_df1.h File Reference

Infinite Impulse Response Direct Form I (DF1) filter definitions. More...

Include dependency graph for iir_df1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  iir_state_df1
 

Macros

#define IIR_DF1_NUM_STATE   4
 
#define SOF_IIR_DF1_4TH_NUM_BIQUADS   2
 

Functions

int iir_init_coef_df1 (struct iir_state_df1 *iir, struct sof_eq_iir_header *config)
 Initialize IIR Direct Form 1 coefficients from configuration header.
 
int iir_delay_size_df1 (struct sof_eq_iir_header *config)
 Calculate required delay line buffer size in bytes for a DF1 configuration.
 
void iir_init_delay_df1 (struct iir_state_df1 *iir, int32_t **state)
 Assign and initialize delay line state memory for DF1 filter.
 
void iir_reset_df1 (struct iir_state_df1 *iir)
 Clear delay history of a Direct Form 1 IIR filter.
 
int32_t iir_df1 (struct iir_state_df1 *iir, int32_t x)
 Calculate IIR filter consisting of biquads.
 
int32_t iir_df1_4th (struct iir_state_df1 *iir, int32_t x)
 Calculate IIR filter consisting of biquads, special simplified version for 4th order filter with two biquads in series.
 

Detailed Description

Infinite Impulse Response Direct Form I (DF1) filter definitions.

Macro Definition Documentation

◆ IIR_DF1_NUM_STATE

#define IIR_DF1_NUM_STATE   4

◆ SOF_IIR_DF1_4TH_NUM_BIQUADS

#define SOF_IIR_DF1_4TH_NUM_BIQUADS   2

Function Documentation

◆ iir_delay_size_df1()

int iir_delay_size_df1 ( struct sof_eq_iir_header *  config)

Calculate required delay line buffer size in bytes for a DF1 configuration.

Parameters
configPointer to IIR equalizer configuration header.
Returns
Required delay buffer size in bytes.

◆ iir_df1()

int32_t iir_df1 ( struct iir_state_df1 *  iir,
int32_t  x 
)

Calculate IIR filter consisting of biquads.

Parameters
iirIIR state with configured biquad coefficients and delay lines data
xSingle s32 Q1.31 format input sample
Returns
Single s32 Q1.31 format output samples

◆ iir_df1_4th()

int32_t iir_df1_4th ( struct iir_state_df1 *  iir,
int32_t  x 
)

Calculate IIR filter consisting of biquads, special simplified version for 4th order filter with two biquads in series.

Note: There are no checks for iir struct members.

Parameters
iirIIR state with configured biquad coefficients and delay lines data
xSingle s32 Q1.31 format input sample
Returns
Single s32 Q1.31 format output samples

◆ iir_init_coef_df1()

int iir_init_coef_df1 ( struct iir_state_df1 *  iir,
struct sof_eq_iir_header *  config 
)

Initialize IIR Direct Form 1 coefficients from configuration header.

Parameters
iirPointer to DF1 filter state structure.
configPointer to IIR equalizer configuration header.
Returns
0 on success, negative error code on failure.

◆ iir_init_delay_df1()

void iir_init_delay_df1 ( struct iir_state_df1 *  iir,
int32_t **  state 
)

Assign and initialize delay line state memory for DF1 filter.

Parameters
iirPointer to DF1 filter state structure.
stateDouble pointer to delay state buffer (updated with new buffer offset).

◆ iir_reset_df1()

void iir_reset_df1 ( struct iir_state_df1 *  iir)

Clear delay history of a Direct Form 1 IIR filter.

Parameters
iirPointer to DF1 filter state structure.