Q calculation on equalizer with fixed bands.

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I'm the new of the newest in this (but I had made somethings with stuff like SynthMaker).

I have a graphic equalizer, fixed bands with two frequency configurations: 1 octave and 1/3 octave.

I'm not sure how to fix the Q for each band. Given this relationship between q, central frequency and bandwidth:
Q=f0/bw
Do I have to calculate the Q for each band like:

Code: Select all

Q250Hz = 250/0.33; //->  1/3 octave
Q1000Hz = 1000/0.33; //->  1/3 octave
..
..
Or do I have to use just one Q for all? If so, how do I know which one?

Here is a online convertor: http://www.sengpielaudio.com/calculator-bandwidth.htm that gives
BW 0.33 = Q 4.36
But that is what? the Q of 1/3 octave of 1.5Khz? :scared:

Thanks in advance.

Post

It's the same Q for all. The bandwidth is not the reduced bandwidth, it's the total bandwidth in Hz (so that Q is unit less).
The is an log2 computation between the bandwidth in octaves and the quality factor, which is what the site computes. But once you have one Q factor for one band, it's the same for all bands.

Post

Thank you Miles1981!

I will use what that sites says and look for the formula (log2) to know it! :)

Post

Hi distante

If you google, as best I recall, somewhere you can find ISO suggested Q for ISO standard band centers. I have seen it online before, but do not know a link. However those Q's may be more relevant for spectral analysis.

The suggested Q MAY be slightly different than a simple third-octave bandwidth Q, because of band overlapping requirements. I can't recall.

In so-called "constant Q" equalizers, the actual Q of the filter must be adjusted according to the amount of boost or cut. If you use the same Q value of a bandpass, and add or subtract along with the original signal, the boost bandwidth will get wider as you increase the boost-- And the cut bandwidth will get narrower, as you increase the cut.

Sometimes people try to adjust the Q so that regardless of the cut or boost amount, that the mid-point of the boost or cut will have the desired bandwidth. For instance, perhaps if the boost is +3 dB, the bandwidth might be 0.33 at the +1.5 dB points. But at a boost of +12 dB, the bandwidth might be 0.33 at the +6 dB points. If the band cut is -9 dB, then the bandwidth might be 0.33 at the -4.5 dB points. Etc.

The RBJ EQ cookbook formulas for peaking filter have one example of Q adjustment according to the amount of boost/cut. On the music-dsp mailing list there have been useful discussions about this, which can be searched out.

Post

Hello JCJR

I want to emulate a little bit the Q of the analog graphic equalizers, I have seen a couple that say they had a constant Q.

I'm not doing something complex, but I want to be able to identify (for example) when I'm applying +12dB of 100Hz and when +12dB of 180Hz.

edit:

in RBJ Cookbook says:
FYI: The relationship between bandwidth and Q is
1/Q = 2*sinh(ln(2)/2*BW*w0/sin(w0)) (digital filter w BLT)
or 1/Q = 2*sinh(ln(2)/2*BW) (analog filter prototype)

Post

Hi distante

I think most modern equalizers try to be "constant Q" because it is very predictable. The "constant Q" EQ ideal behavior-- All levels of boost would be about the same width on a log/log frequency response chart. A band would have about the same width (in octaves) on the log/log chart, regardless of the band's center frequency. A low band would have the same width on the chart as a high band, so long as each band is set to the same width (in octaves).

Cuts would follow the same rules. A -3 dB cut would be the vertical mirror image of a +3 dB boost, and a +12 dB boost would be the vertical mirror image of a -12 dB cut.

Other response characteristics are sometimes useful, but people like that consistent symmetrical behavior so far as I know. As mentioned earlier, the oddity is that especially in digital filters, if you make an EQ out of bandpass filters, then in order to get this "constant Q" EQ behavior, you have to adjust the width of the bandpass filter according to each level of boost or cut. Analog equalizers can better exploit feedback techniques, making it somewhat easier to get "constant Q" behavior without as much brain damage.

The bandpass filter has to be "automatic variable Q according to the current amount of boost/cut" in order to get the constant-Q equalizer behavior. If you set the bandpass filter to a constant Q, the equalizer based on that bandpass filter is not likely to be constant Q. The Equalizer band would tend to get wider the more you boost, and the band would get narrower the more you cut.

RBJ's peaking filter is like a single band of a parametric or graphic EQ. You can string several peaking filters in series to make a graphic or peaking parametric. His peaking filter coff calculations automatically adjust the width every time you change the peaking filter gain. RBJ also has adjustments according to boost/cut amount, in his high and low shelving filters. Supposedly some other shelving filter codes work a little better in staying perfectly consistent according to boost or cut.

There are many ways to make an EQ and I'm not an expert. Just mentioning that little detail so you can watch for it when coding or studying.

In analog filters (and I suppose in some calculations of digital filters) there is another term named Damping. Damping = 1 / Q and of course Q = 1 / Damping.

In common "resonant" second order IIR filters, Damping will usually range from 0 to 2, and Q will usually range from infinity to 0.5. However it is possible for Q to be less than 0.5 and damping greater than 2. Outside the mentioned range, filter curves are very gradual and not considered resonant.

At very big Q (or very small damping) filters tend to become oscillators.

Big Q narrow IIR filters can ring, sometimes unpleasantly affecting the time-response of the EQ. This seems more likely noticeable (when noticeable at all) with lower frequencies, and with boosts. Notches or EQ cuts also affect the signal time-response, but do not seem so noticeable to the ear. So far as I know.

Post

EDIT: I just noticed that most of the below is similar to info on that Q calculator page you linked, but might as well post it because it was already written. Maybe explaining it a little different will help comprehension.

When using log scaling, which makes things easier with typical filters--

If you know the upper and lower -3 dB points of a bandpass filter, but you don't know the center frequency, it is the geometric mean-- Fc = SQRT(Fl * Fu);

If you know the center frequency, then the upper -3 dB point will be [Fc * SomeMultiplier], and the lower -3 dB point will be [Fc / SomeMultiplier]. Which keeps your desired Fc at the geometric mean of the two calculated cutoff frequencies. The multiplier ought to be > 1.

ABSOLUTE BANDWIDTH is merely the difference between Fu and Fl-- AbsBandwidth = Fu - Fl;

FRACTIONAL BANDWIDTH is more useful with log plotted values. FracBandWidth = (Fu - Fl) / Fc;

PercentageBandwidth = FracBandWidth * 100;

So far as I know, OctaveBandwidth = log2(Fu / Fl) --- Maybe some Equalizers use a different definition, dunno.

You can calculate a multiplier to find an octave spacing above or below a given frequency-- OctMult = 2 ^ (NumOctaves); For instance, a half octave multiplier would be 2 ^ 0.5 = 1.414. A sixth-octave multiplier would be 2 ^ (1 / 6) = 1.122462. So the upper -3 dB cutoff for a third-octave bandpass would be Fc * 1.122462 and the lower -3 dB cutoff would be Fc / 1.122462. A sixth octave up plus a sixth octave down = a third octave total.

To double-check-- OctaveBandwidth = log2(1.122462 / (1.122462^-1)) = 0.33333333;

In analog filter design it is common to work with a normalized frequency, and then after finding the solution the filter can be scaled to any frequency and it ought to have the same behavior, except for real-world defects. For instance, calculating the prototype filter at a frequency of 1 Hz, or at an angular frequency of 2*pi.

This works ballparking your filter specs as well. Because (except for real-world defects) your 300 Hz filter will work about the same as your 1 kHz filter (plotted as log/log), you can figure it based on 1 Hz and it will work about the same after you scale it.

Q is also the inverse of FractionalBandwidth-- Q = Fc / (Fu - Fl). So given our third-octave Fu and Fl we calculated above-- Q = 1 / (1.122462 - (1.122462^-1)) = 4.318;

Which is about the same answer given by that Q calculator page you linked, which uses a slightly different formula, with about the same result.

You get the same Q for the same frequency ratios, regardless of the filter center frequency. For instance calculating for a 1 kHz center frequency--

Q = 1000 / ((1000 * 1.122462) - (1000 / 1.122462)) = 4.318;

Post Reply

Return to “DSP and Plugin Development”