So, on a new module I’m working on I want to display its frequency response. It is seven filters that can be in any combination of parallel and serial. That part of the display I have working.
The issue is the underlying frequency response of the the Biquad filters I am using. I’m using the standard BiQuad filter code that rack offers, and I found this code for calculating the frequency response:
float w = 2.0*M_PI*frequency;
float numerator = a0*a0 + a1*a1 + a2*a2 + 2.0*(a0*a1 + a1*a2)*cos(w) + 2.0*a0*a2*cos(2.0*w);
float denominator = 1.0 + b1*b1 + b2*b2 + 2.0*(b1 + b1*b2)*cos(w) + 2.0*b2*cos(2.0*w);
float magnitude = sqrt(numerator / denominator);
The issue is that the above code works great except for calculating the response for frequencies below about 100hz - and the Q makes a big difference. Above 100hz or so, the graph looks great and just like what you would expect, but it gets real noisy below.
Any ideas what I’m doing wrong here? The filters themselves sound great…just the display