ARM-software / CMSIS-DSP

CMSIS-DSP embedded compute library for Cortex-M and Cortex-A
https://arm-software.github.io/CMSIS-DSP
Apache License 2.0
454 stars 122 forks source link

how to use arm_biquad_cascade_df1_q15() with a high order iir filter #149

Closed zjtlfc closed 5 months ago

zjtlfc commented 5 months ago

i don't know how to set the coef.

christophe0606 commented 5 months ago

@zjtlfc You need to use a tool like SciPy or Matlab. Here is an example from Python showing how to generate the second order sections (sos) https://developer.arm.com/documentation/102463/0100/How-to-implement-biquads-to-filter-an-Electrocardiography-signal

If you don't define the IIR with poles and zeros but use a rational fraction, then there are SciPy functions to convert it to sos.