Important: Please read the Qt Code of Conduct -

How to plot audio equalizer's filters graph?

  • I'm making an equalizer application and I'd like to make it... well, special. And because showing sliders for each filter is too mainstream I've decided to use a graph to show the actual equalizer curve (please note: NOT the real-time audio spectrum!). Thing is... I don't have any idea how to do that. I mean, I know I need to use some graph plotting libraries, I'm actually very interested in using "QCustomPlot": but I can switch to other libraries as well.

    So, I'd like someone to help me drawing this:

    They seem to be simple curve graphs, but actually equalizer filters have a very important parameter, the Q Factor (Qf). The Qf determines how much a filter's gain affects the near frequencies. Graphically it represents how much a filter's curve extends on the graph. In the image above you can see filters 1 and 2 that have a very narrow curve (small Qf), while filters 3 and 4 have a very large curve (large Qf). And also, filters might be very near one next to the other, and this means that the graph curve needs to interpolate between the curves of the two filters. For example, next there is an image with many filters applied: (look at the 'Audio 1' window)

    I know I have chosen a task that's beyond me right now, but I'd really appreciate if someone with some experience in the audio field could help me drawing this kind of graph. As always, any suggestions are appreciated too, and thank you in advance! :-)

  • Lifetime Qt Champion


    You might be interested in the "Qwt": library to do the drawing

    Hope it helps

  • Moderators

    if you want to do this yourself it's just a matter of math ... i can't help you with that, or better said, i don't want to ^^
    But i believe that shouldn't be a problem since you already explained the parameters the curve is composed of?
    If you did the math to calculate the curves/points you can use QPainter's facilities to draw the actual graph line.

  • Doing that myself seems impossible to me right now, because I don't have enough math knowledge to get from some calculus to drawing a curve. SO I'm looking for something more "automatic" that, given a certain filter with its F, G and Qf, it automatically draws the whole curve as it should be with all the filters interpolated when needed.

    About Qwt, I had a look at it and I'm sure I cold use it too, but this library is far more specialized and includes a lot classes with functions that I don't need; so I'm trying not to use it if possible to reduce the final size of my application. That's why I liked QCustomPlot, it's very small and should be able to do the job. But anyway I'll be having a further look into it.

Log in to reply