Skip to main content
8 votes
Accepted

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

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 ...
Dan Boschen's user avatar
  • 52.3k
6 votes
Accepted

Avoiding clicks with changing biquad coefficients

Another possibility is to send the coefficients as poles and zeros and interpolate/smooth in the z-plane instead of the coefficient domain. This is always guaranteed to be stable. You can either ...
Hilmar's user avatar
  • 45.5k
6 votes

Series vs Parallel Biquad Filters

It really depends on your filter. In my experience serial is has almost always the potential to be better. The reason for this is quite simple. The parallel representation is unique. There is one ...
Hilmar's user avatar
  • 45.5k
5 votes
Accepted

Prewarping both resonant frequency $f_0$ and bandwidth (or $Q$) when using bilinear transform

alright, there are a couple of different issues that may (or may not) need to be de-conflated. i'm gonna try to keep the number of symbols minimized. $dB_\text{gain}$ is the number of dB gain of the ...
robert bristow-johnson's user avatar
5 votes
Accepted

Series vs Parallel Biquad Filters

Is this because of precision issues in fixed point?Is this still true for floating point schemes? Floating point has its own precision issues. Often a carefully-executed 32-bit fixed-point filter ...
TimWescott's user avatar
  • 12.9k
4 votes
Accepted

Is it possible to combine two or more Biquads?

Possible, yes. But higher-order IIR filters tend to be less stable and more susceptible to various numerical problems (lost precision, underflow, overflow, etc.), compared to a cascade or bank of ...
hotpaw2's user avatar
  • 35.4k
4 votes

Avoiding clicks with changing biquad coefficients

I think the basic premise of your question is incorrect. Interpolating coefficients doesn't lead to unstable filters in biquads; moreover, it is very easy to prove. Just plot a1 vs a2 and you'll see ...
Juan Sierra's user avatar
4 votes

How to calculate biquad coefficients for the partial (1%, 10%) applying of pre-emphasis effect

I have too few points for to comment so I try give you at least a partial answer. You can't change those b coefficients using equal multiplier with a's. As those final coefficients comes from ...
Juha P's user avatar
  • 917
3 votes
Accepted

What's the point of MATLAB's scaling array for secord-order-section filters?

Of course an SOS matrix is capable of completely describing the filter including the gain. However, in the Matlab SOS matrix the $b_0$ coefficients are all equal to $1$ by default (if no extra scaling ...
Matt L.'s user avatar
  • 90.5k
3 votes
Accepted

How do scaling of the coefficients for the poles of a biquad filter affect the gain?

Sorry, that doesn't work. You have to scale all numerator (the "b") or all denominator coefficients (the "a") at the same time. That doesn't work for the denominator since you all practical ...
Hilmar's user avatar
  • 45.5k
3 votes

Biquad cookbook formula for broadcast FM de-emphasis?

Taken from this excellent RDS tutorial, and original source: De-emphasis filter, $H(s) = \frac {1} {RC.s + 1}$, implemented as IIR filter via a bilinear transform: ...
mins's user avatar
  • 463
3 votes

Biquad cookbook formula for broadcast FM de-emphasis?

You could also implement a 2nd order IIR filter which has response of 1st order filter by using some other TF but one used in RBJ's cookbook. Here's one way to do it using MZT (C++). ...
Juha P's user avatar
  • 917
3 votes

How to calculate biquad coefficients for the partial (1%, 10%) applying of pre-emphasis effect

So, sox defines its biquad operation parameters as follows: biquad b0 b1 b2 a0 a1 a2 Apply a biquad IIR filter with the ...
Marcus Müller's user avatar
3 votes
Accepted

Why does my low pass filter diverge below 7000 Hz?

Let's try this in Octave/Matlab: a = [1,-1.601089848140876,0.668366341586459]; b = [0.016819123361395717,0.033638246722791434,0.016819123361395717]; r = roots(a); abs(r) ans = 0.81754 0.81754 ...
Matt L.'s user avatar
  • 90.5k
3 votes

What is the $Q$ of successive Second-Order Sections of an $N$th-order Butterworth low-pass filter?

It is well-known that the poles of a normalized continuous-time $N^{th}$-order Butterworth lowpass filter lie on a semi-circle with radius $1$, centered at $s=0$: $$p_n= e^{j\pi(2n-1+N)/2N},\qquad n=1,...
Matt L.'s user avatar
  • 90.5k
3 votes
Accepted

design of cascaded biquad filter

If you note on the upper left corner of the upper plot, the magnitude is close to 40,000. An error of 15 is not very significant. The reason we decompose (factor) the higher order filter into 2nd ...
Dan Boschen's user avatar
  • 52.3k
3 votes

using scipy.signal.sosfilt to filter a stereo signal with zi, zf

After more fiddling, I figured it out: need to specify axis=1 n_sections is the number of second-order sections, not filter order. So if N is the number of input ...
fearless_fool's user avatar
3 votes
Accepted

low shelving filter frequency response diagnosis

Your filter coefficients and your difference equation are wrong. You assumed that the output signal $y[n]$ is fed back to the input, but what is actually fed back is the signal before the multiplier $...
Matt L.'s user avatar
  • 90.5k
3 votes

First order filters in Direct Form I (RBJ Cookbook)

A solution with the DC or Nyquist bin zeroed for a high pass or low pass respectively with real coefficients is: LOW PASS $b_0 = \frac{1+a_1}{2}$ $b_1 = b_0$ $b_2 = 0$ $a_0 = 1$ $a_1 = -\frac{\cos(\...
Dan Boschen's user avatar
  • 52.3k
3 votes
Accepted

First order filters in Direct Form I (RBJ Cookbook)

Okay, I'm gonna try to toss out here my first guess of general 1st-order filters done in the style of the Audio EQ Cookbook. The cookbook assumes the same EE definition of resonant frequency and ...
robert bristow-johnson's user avatar
2 votes

Is there a method to calculate the maximum gain of a biquad?

Let me refer to the denominator coefficients as the pole coefficients, and the numerator coefficients as the zero coefficients. This is for those who visualize poles as able to peak magnitude, and ...
Nigel Redmon's user avatar
2 votes
Accepted

Is there a method to calculate the maximum gain of a biquad?

in this previous answer, the squared-magnitude of a biquad frequency response is shown to be: $$\begin{align} f(\phi) \triangleq |H(e^{j\omega})|^2 & = \left| \frac{b_0 + b_1 e^{-j\omega} + b_2 ...
robert bristow-johnson's user avatar
2 votes

IIR biquad real-time filter just output noises

It looks like you got your a and b coefficients swapped. The feedback terms: b0,b1,b2, should be tiny (around 0.00x), and a0,a1,a2 can be close to 1 or 2 in magnitude.
hotpaw2's user avatar
  • 35.4k
2 votes
Accepted

IIR biquad real-time filter just output noises

I was unable to get a stable filter using your coefficients. You did not state, but am assuming this is a lowpass filter. Using the calculator here, I got: ...
Stephen Rauch's user avatar
2 votes
Accepted

Biquad filter from Matlab to C using "tf2sos"

What I can see from the code is the following mapping between the array coeffs[] and the filter coefficients $a_i$ and $b_i$ (note that $a_0=1$ and is not stored in ...
Matt L.'s user avatar
  • 90.5k
2 votes

Avoiding clicks with changing biquad coefficients

You could limit the rate of sending a change of coefficients to that of the cross fade duration. But send the latest setting at each duration tick (every 16 mS video frame or equivalent, for instance)...
hotpaw2's user avatar
  • 35.4k
2 votes

Avoiding clicks with changing biquad coefficients

The reason why interpolating the coefficients would cause instability is that intermedite set of coefficients values could potentially produce poles outside the unit circle, thus making your filter ...
Florent's user avatar
  • 754
2 votes
Accepted

Help with audio EQ cookbook BPF filters and Q

i believe that what you're seeing is the compression of bandwidth done by the frequency warping inherent with the bilinear transform. now, if you look at cookbook, the bandwidth $BW$ is expressed in ...
robert bristow-johnson's user avatar
2 votes
Accepted

Can a Goertzel filter response be mapped to a Direct Form II Biquad IIR Filter

try it, you'll like it. the form in the Jocobson & Lyons paper is Direct Form II, with the coefficients explicit. the form in the CMSIS source is a transpose of a Direct Form I, i believe, and ...
robert bristow-johnson's user avatar
2 votes
Accepted

How would I calculate the state-variables of digital biquad filter (direct form II transposed) at steady-state?

Consider a discrete-time LTI system (that's your second order stage) described by a LCCDE in the form of a recursion equation: $$y[n] = a y[n-1] + b y[n-2] + c x[n] + d x[n-1] $$ where $a,b,c,d$ are ...
Fat32's user avatar
  • 28.3k

Only top scored, non community-wiki answers of a minimum length are eligible