Is there a Graphic Eq graph plot component available?

I am making an editor for a digital Graphic Eq and would like to have the standard frequency graph as a visual display. I would like to input centre frequency, Q and Gain (+/- dB) of up to 12 filters and have a component draw the graph for me.
I would like so when I changed a value (Freq/Q/gain) the graph would redraw/update in real-time.

Is this a component that already exists?

1 Like

i think you will need to roll your own : )

You need to get the transfer function for the filter/eq. Once you’ve got that glorious graphs await…

This was drawn using this:

double getMagnitudeAtFrequency(double freq)
    auto f2pi = 2.0 * M_PI * freq;
    std::complex<double> z(cos(f2pi), sin(f2pi));
    std::complex<double> z2 = z * z;
    std::complex<double> h =
    (b0a0 * z2 + b1a0 * z + b2a0)
    (1.0 * z2 + a1a0 * z + a2a0);
    return std::abs(h);

I’ll try and remember how I arrived at that :wink: But hopefully it works out from the transfer function for the biquad here:

Where the b0a0, b1a0 etc. are the filter coefficients.


I think, this would be a nice addition for Fabians DSP class, when it arrives. :slight_smile:
Its Xmas soon, so let me add another wish:
I would also wish for a basic GUI for reverb!

There is a component floating around in the interweb which draws a frequency plot from
IIR coefficients. Search for Sean Enderby’s FilterGraph (I am using a adaption of it myself)

Yeah, the SAFE module has an updated version of that.


Thanks for the suggestions. I did the the “graphpaper” - had a quick look, found an equation to use and thought “am I re-inventing something that already exists?” and then got divereted. Anyway thanks to the sugestions I know the correct way forward. The bi-quad makes sense to me I can use that. I like Sean’s suggestion too.

Excuse me but, how I can use that code?
I need a graph for my biquad filters, I have coefficients calculators in my app and the equations for the various types of filters…

(Don LaFontain voice:) Meanwhile in JUCE-land, a new dsp module has landed…

Now you can use coefficients of your filters to get the magnitudes for each frequency using dsp::IIR::getMagnitudeForFrequencyArray() and dsp::FIR::getMagnitudeForFrequencyArray(), that you easily can plot.
If you chain filters, that means usually multiplying the frequency response (in gains) or adding in dB…

I did a project for my own upskilling on the dsp module, you can get inspiration of the code here:



Thank you very much @daniel.
But I have used the stk from CCRMA Stanford for the filter and I’ve found a module written by senderby called JUCE Filter Graph Component and I have edited it for my needs. It is a bit confusing, but at least it works.
But for my next projects I will use your DSP module.

I realize that this is a VERY old thread… but still in 2023, there doesn’t seem to be any good reference for how to do this, so I tried this piece of code. And it works!

EXCEPT: You have to divide f2pi by the sample rate.

I eventually realized this after looking at the source of double dsp::IIR::Coefficients< NumericType >::getMagnitudeForFrequency()

Just for future reference, if there happen to be others who are banging their heads against the wall like I did yesterday night… :stuck_out_tongue:

1 Like