January 29, 2015
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.
January 29, 2017
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.
January 29, 2015
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,
January 29, 2017
You need one separate biquad object for each filter.
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));
Most Users Ever Online: 36
Currently Online: TheSmile
Currently Browsing this Page:
Guest Posters: 1
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