Sound Open Firmware
Loading...
Searching...
No Matches
iir_df1.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2022 Intel Corporation. All rights reserved.
4 *
5 * Author: Andrula Song <andrula.song@intel.com>
6 */
7
14#ifndef __SOF_MATH_IIR_DF1_H__
15#define __SOF_MATH_IIR_DF1_H__
16
17#include <stddef.h>
18#include <stdint.h>
19#include <sof/common.h>
20
21#define IIR_DF1_NUM_STATE 4
22#define SOF_IIR_DF1_4TH_NUM_BIQUADS 2
23
25 unsigned int biquads; /* Number of IIR 2nd order sections total */
26 unsigned int biquads_in_series; /* Number of IIR 2nd order sections
27 * in series.
28 */
29 int32_t *coef; /* Pointer to IIR coefficients */
30 int32_t *delay; /* Pointer to IIR delay line */
31};
32
34
42 struct sof_eq_iir_header *config);
43
50
56void iir_init_delay_df1(struct iir_state_df1 *iir, int32_t **state);
57
62void iir_reset_df1(struct iir_state_df1 *iir);
63
70int32_t iir_df1(struct iir_state_df1 *iir, int32_t x);
71
80int32_t iir_df1_4th(struct iir_state_df1 *iir, int32_t x);
81
82/* Inline functions */
83#if SOF_USE_MIN_HIFI(3, FILTER)
84#include "iir_df1_hifi3.h"
85#elif SOF_USE_ARM_SIMD(FILTER)
86#include "iir_df1_arm.h"
87#elif SOF_USE_RISCV_SIMD(FILTER)
88#include "iir_df1_riscv.h"
89#else
90#include "iir_df1_generic.h"
91#endif
92
93#endif
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 ...
void iir_init_delay_df1(struct iir_state_df1 *iir, int32_t **state)
Assign and initialize delay line state memory for DF1 filter.
int32_t iir_df1(struct iir_state_df1 *iir, int32_t x)
Calculate IIR filter consisting of biquads.
void iir_reset_df1(struct iir_state_df1 *iir)
Clear delay history of a Direct Form 1 IIR filter.
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.
Generic C implementation of Direct Form I IIR filtering for various bit depths.
Definition iir_df1.h:24
int32_t * coef
Definition iir_df1.h:29
unsigned int biquads_in_series
Definition iir_df1.h:26
int32_t * delay
Definition iir_df1.h:30
unsigned int biquads
Definition iir_df1.h:25
Definition eq.h:117