Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
IIR Filters quality
No permission to create posts
March 5, 2015
7:02 am
Forum Posts: 10
Member Since:
January 29, 2015
sp_UserOfflineSmall Offline

i am just approaching to IIR *Low Pass* filters and i am completely new(bie) to these arguments.
So i have some doubt about how things work.

1) Using the BiQuad with the Second order bi-linear and Massberg algorithms, i can't get the difference how this affects the overall sound of the filter.
Do they just tune the coefficients in a different way ?

2) For lowest frequency (100 Hz) and highest Q (20), i get clipping. I actually don't understand if it is just clipping due to the gain that Q peak adds, or it's that the algorithm as it is, can't compute precisely at such frequency/Q.
There is a way to smooth the output of the filter without losing the emphasis at cutoff frequency ?
Can this be achieved tuning the coefficients or with different algorithms ?

3) Hearing the behavior of some hardware low pass filter, i can hear that at lowest frequencies and high Q, it is like the output of the emphasized frequencies at cutoff have a bit more release time. I can kinda hear that also with these IIR low pass filters algorithms, but as i mentioned i obtain clipping as well. There are methods or algorithm optimizations to avoid the clipping ?

4) What would happen calling recursively the BiQuad for N times ? in a First order IIR filter would that be like feeding back N more past samples ?

Sorry for the lots of questions, i just want to understand more from a general point of view the relation cause-effect of the designs.
- Vito

March 6, 2015
11:35 pm
W Pirkle
Forum Posts: 247
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

Hi Vito

Some quick answers for you:

1) the Massberg filter has finite gain at Nyquist, so for high cutoff frequencies, there is more "air" in the output (more HFs). Whether this is audible might be the subject of debate/listening tests, but for sure it is closer to how the analog filter's output looks.

2) increasing the Q on "classical" filters as in the FX book is going to increase gain.


With a Q = 20, the peak gain is about +24dB which is a huge amount; in my Synth book, I do over several other filters that mitigate this issue: the Moog Ladder and Diode Ladder both reduce overall gain as the Q is increased so they do not suffer from the clipping. The Korg35 filter uses a diode-clipper circuit to limit the overall gain as Q is increased. Doing this with the classical bilinear biquad filters is not difficult - as the Q increases, lower the overall gain by adding a gain coefficient in front of the whole H(z). You would need to experiment to get the kind of reduction you desire. Another option is to alter the a0 term (which controls gain) but you will need to alter a1 and a1 to become alpha1, alpha2 as per the book, chapter 5.

3) release time does not play a role in filters vs Q. Clipping can be avoided with 2) above.

4). You don't want to recursively call the biquad doFilter(). It should only be called once per sample period. If you want higher order filters, you cascade multiple filters together. This is a ton of information about that all over the internet and in nearly every DSP or Analog Filtering textbook.

- Will

March 7, 2015
3:23 pm
Forum Posts: 10
Member Since:
January 29, 2015
sp_UserOfflineSmall Offline

Hi Will,
thanks for your answer, you shed some light on my doubts.
Only one more thing.
i am afraid i am misunderstanding the concept of cascading the filters.

I mean, let's say that i want to put in cascade a Second order bilinear and a Massberg filter:
what it looks to me how it is done is: i will calculate the coefficients for Second order bilinear and then call the doBiQuad for that, get the result in a variable "A", then calculate the coefficients again for the Massberg filter, and call the doBiQuad(A) (feeding previous result from the doBiQuad).

But something looks kinda wrong in this way, because it looks like i am recursively calling the Biquad, just with different calculated coefficient.

Can you show me a quick example of the call flow ?

Thanks a milion,

March 8, 2015
12:01 am
W Pirkle
Forum Posts: 247
Member Since:
January 29, 2017
sp_UserOfflineSmall Offline

Hi Vito

You need one separate biquad object for each filter.

CBiQuad filter1;
CBiQuad filter2;

then set filter1's coefficients to bilinaer/biquad and filter2's coefficients to Massberg.

float output = filter1.doBiquad(xn);
output = filter2.doBiquad(output);

or nest them

float output = filter2.doBiQuad(filter1.doBiQuad(xn));

- Wil

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online: TheSmile
4 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Peter: 41

Frodson: 40

clau_ste: 39

Gwen: 32

JimmyM: 30

TheSmile: 27

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 522

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 31

Topics: 545

Posts: 2134

Newest Members:

Bill, hill william, NAUN_SONAR, sufy, Diane, Richard, drvenkman, venkman, Jfx, drorh

Moderators: W Pirkle: 247

Administrators: Tom: 67, JD Young: 80, Will Pirkle: 0, W Pirkle: 247