scipy butterworth filter to arm cmsis

27 Views Asked by At

Witn scipy, I did some experiments with a butterworth filter like this:

sos = butter(order, normal_cutoff, btype='low', analog=False, output="sos")

I expect sos to be the coefficient of the filter.

I need to port this filter to an arm platform. There are several filters functions implemented in the CMSIS library but I don't understand if butterworth falls into one filter familly implemented in CMSIS.

My question is: shoud I implement butterworth myself or is there a cmsis function for that?

1

There are 1 best solutions below

0
BjornW On

The implementation is not related to the filter design (Butterworth in this case) but the structure of the filter, the return here is a chain of second-order sections (SOSes) where each section is a 2nd order IIR filter.

I haven't tested this myself yet but had the same question and this is the functions to use from CMSIS:

https://www.keil.com/pack/doc/CMSIS/DSP/html/group__BiquadCascadeDF1.html

You can look at the graphs there on how the SOS sections chain and how the coefficents are defined. However I'm unsure on the sign of the a coefficients, as they mention in the CMSIS article, you need to be careful to check that the signs of these in the filter design algorithm match the sign that the CMSIS functions use.