# 4th order high-pass filter on a DSP: standard or biquads?

I have two C implementations of 4th order high-pass filter (fs = 16 kHz, cut-off=100 Hz, designed using Matlab butter() function):

• 1st. Done as standard difference equation implementation.

• 2nd. Done as product of two Biquad sections.

The final implementation will be a fixed-point DSP code.

Why is biquad implementation recommended?

• Define "better". Better is the improved version of good. You need to say what you consider a measure for Goodness first before we can discuss better, or else, we'd have to write half a bookshelf on theoretical and practical filter design. – Marcus Müller Feb 24 '17 at 10:04
• This depends largely on where the cutoff frequency of the high pass is – Hilmar Feb 24 '17 at 16:47
• It probably also depends on what "this task" is. – MBaz Feb 24 '17 at 17:45
• Updated question with some more info. – Danijel Feb 27 '17 at 7:30

## 1 Answer

The two solutions in a floating point implementation are assumed to be identical, with the two BiQuads being a factored version of the standard difference equation. The BiQuad is the better way to go for fixed point as you isolate two 2nd order systems and in doing so will be easier to keep stable under variations due to the quantization involved.

For more details on this, see the responses to this post:

How does cascading biquad sections for higher order filters work?

and

https://en.wikipedia.org/wiki/Digital_biquad_filter

Note too for those less familiar: cascading two filters is the same mathematically as convolving their coefficients; multiplying two polynomials is done by convolving their coefficients. The transfer function for filters is described by polynomials so it is all the same thing; a 4th order filter can be factored into two 2nd order filters.

• So it's mainly a matter of stability due to quantization. Great, thanks. – Danijel Feb 27 '17 at 13:33
• That an in actual implementation delay can also be a significant factor since you would be cascading multiple stages with large feedback paths. The biquad implementation isolates these feedback paths to shorter regions as well. – Dan Boschen Feb 27 '17 at 13:35