Page 1 of 1

3rd order IIR filter

PostPosted: Fri Nov 20, 2015 3:03 pm
by Rocko

I'd like to research a 3rd order LP and HP design, preferably as 'code' not 'assembly' so I can understand the logic.
Is there any such example ?
How can I calculate the coefficients for these cases? Most 'links' I find explain about bi-quads (2nd order) not 3rd order.

On the 'Dozius filter pack' I found a close example but it is coded as assembly.

Any 'blue code' example out there? (both LP and HP) ?


Re: 3rd order IIR filter

PostPosted: Sun Nov 22, 2015 11:29 pm
by martinvicanek
Hey Roco, 3rd order IIR filters offer more degrees of freedom compared to biquads. You can decompose any 3rd order IIR filter into a first order IIR filter followed by a biquad. We have both 1st and 2nd order filter types covered at FS Guru, so you might want to take a look.

The coefficients will depend on the filter specifications. You may use the extra flexibility e.g to design a flat passband and a steep (18 dB/octave) rolloff. That would be a Butterworth filter, which is easy to design because the cutoff frequencies of all sections are equal. I have included a highpass and a lowpass in the schematic below (unoptimized, since you asked for readable code). Butterworth highpass/lowpass pairs of odd order are complementary, i.e. their outputs added yields an allpass.

Have fun!