HDL-MIC · Documentation

Equalizer

The equalizer performs frequency correction of the signal: it changes the gain in specified frequency bands. A parametric equalizer is implemented — a cascade of up to 16 biquad sections with independently adjustable centre frequency, gain and quality factor of each band.

Purpose

A filter (see “Filters”) performs frequency selection: it passes a frequency band and suppresses the components outside it. The equalizer performs magnitude response correction: it attenuates or boosts individual bands by a specified number of decibels, including bands within the filter passband. Typical tasks:

The equalizer is placed in the processing chain after the filter and before noise reduction. Its output is used in all “processed” modes: level calculation, spectrum and spectrogram, listening and recording. Parameters may be changed during a measurement; in windowed mode each window is processed with zero initial conditions (see “Filters”).

Structure and transfer function

The equalizer is a cascade (series) connection of biquad sections. The transfer function of the cascade equals the product of the section transfer functions multiplied by the preamplification factor:

HEQ(z) = g · Πi=1…K Hi(z),   g = 10P/20,   K ≤ 16
Hi(z) = (b0i + b1iz−1 + b2iz−2) / (a0i + a1iz−1 + a2iz−2)
20·lg|HEQ(ejω)| = P + Σi 20·lg|Hi(ejω)|   (magnitude response in dB is the sum of the section responses)

Section coefficients are calculated by the formulas of R. Bristow-Johnson (Audio EQ Cookbook):

ω0 = 2π·f0/fs,   α = sin ω0/(2Q),   A = 10G/40

The factor g is included in the b coefficients of the first section. Bands with a centre frequency f0 ≥ 0.98·fs/2 are not realized and are marked in the processing description; peaking and shelving bands with G = 0 dB are excluded from the cascade, since their transfer function is identically equal to one.

The transient duration of the equalizer is determined from the energy of the impulse response: the sample index after which the energy of the remaining part of h[n] is less than 10−4 (−40 dB) of the total energy. It is added to the transient duration of the filter.

Band types

TypeParametersMagnitude response
Peaking (bell)f0, G, QGain G at f0, 0 dB far from f0
Low shelff0, G, QGain G below f0, G/2 at f0, 0 dB above
High shelff0, G, QGain G above f0, G/2 at f0, 0 dB below
Second-order high-passf0, Q−3 dB at f0 with Q = 0.707; roll-off 12 dB/octave
Second-order low-passf0, QThe same for high frequencies
Notchf0, QTransmission zero at f0, bandwidth ≈ f0/Q
Band-passf0, Q0 dB at f0, roll-off 6 dB/octave on both sides

Coefficients of the peaking and shelving filters (the low-pass, high-pass, notch and band-pass formulas are given in “Biquad section”):

peaking: b = [1 + αA, −2cos ω0, 1 − αA],   a = [1 + α/A, −2cos ω0, 1 − α/A]
low shelf: b0 = A[(A+1) − (A−1)cos ω0 + 2√A·α],   b1 = 2A[(A−1) − (A+1)cos ω0],   b2 = A[(A+1) − (A−1)cos ω0 − 2√A·α]
                   a0 = (A+1) + (A−1)cos ω0 + 2√A·α,   a1 = −2[(A−1) + (A+1)cos ω0],   a2 = (A+1) + (A−1)cos ω0 − 2√A·α
high shelf: the same expressions with cos ω0 → −cos ω0 in the brackets and the signs of b1, a1 changed
a) peaking filter, f0 = 1 kHz, G = +12 dB, Q = 1 and Q = 5
b) shelving filters: low shelf, f0 = 200 Hz, G = +9 dB; high shelf, f0 = 3 kHz, G = −6 dB; Q = 0.707

Fig. 1. Magnitude responses of equalizer sections, fs = 16,276 Hz.

Quality factor and bandwidth

The quality factor Q determines the bandwidth of the peaking, notch and band-pass filters: Δf ≈ f0/Q. The bandwidth in octaves N and the quality factor are related by:

Q = 2N/2 / (2N − 1);   N = 1 octave → Q ≈ 1.41;   N = 1/3 octave → Q ≈ 4.32;   N = 2 octaves → Q ≈ 0.67

For shelving filters Q determines the steepness of the transition between the 0 dB and G levels; with Q = 0.707 the transition is monotonic, with larger Q overshoots of the magnitude response appear near f0. The time constant of the transient envelope of a narrow-band section is τ ≈ Q/(π·f0).

Overall response and band interaction

The magnitude response of the cascade in decibels equals the sum of the section responses. When the bands of adjacent sections overlap, their gains add up: the total boost between the centre frequencies may exceed the gain of each section.

Fig. 2. Band interaction: a 125 Hz section (G = +6 dB, Q = 1.41) and a cascade of 63 Hz and 125 Hz sections with the same parameters. The maximum of the overall response exceeds +6 dB.

Graphic and parametric equalizers. In a graphic equalizer the centre frequencies and the quality factor are fixed (for example, the octave series 31.5 Hz…16 kHz according to ISO 266, Q ≈ 1.41), and only the gain is adjusted. In a parametric equalizer all three parameters of each band are adjusted. The implemented equalizer is parametric; the graphic variant is set by a preset.

Preamplification and headroom

Preamplification P (−24…+24 dB) is the overall gain of the cascade. If the maximum of the overall response exceeds 0 dB, the amplitude of the signal components in the corresponding band increases, which may cause the full scale to be exceeded and the signal to be clipped during listening. Headroom is ensured by choosing

P = −maxf Σi 20·lg|Hi(f)|

This value is set by the “Auto preamp” command. When the maximum of the overall response is positive, the interface displays a warning.

Response editor

The editor displays the overall magnitude response of the equalizer (including preamplification), the response of the selected section and, as a background, the spectrum of the current channel (original or processed) in dBFS on the right axis. Each section has a marker: round for the types with the G parameter (peaking, shelving), square for the types without it (low-pass, high-pass, notch, band-pass; the marker is placed at the 0 dB level).

ActionResult
Dragging a marker horizontallyChanges f0 (logarithmic scale)
Dragging a marker verticallyChanges G (0.5 dB step)
Mouse wheel over a markerChanges Q (factor 1.12 per step)
Double click outside markersAdds a peaking section at the given point
Delete keyRemoves the selected section

The table below the graph contains the parameters of all sections for exact input: enable, type, f0, G, Q. Parameters are sent to the processing server 0.12 s after the last change.

Presets

PresetContentsPurpose
Graphic, 10 bandsPeaking sections at 31.5, 63, 125, 250, 500 Hz, 1, 2, 4, 8, 16 kHz; Q = 1.41; G = 0Octave magnitude response correction
Parametric, 5 bandsLow shelf 100 Hz; peaking 300 Hz, 1 kHz, 3 kHz; high shelf 6 kHz; G = 0Initial configuration for parametric correction
Mains hum suppressionNotch sections at 50, 100, 150, 200, 250 Hz; Q = 8Suppression of the mains fundamental and harmonics
Low-frequency suppressionSecond-order high-pass 80 Hz, Q = 0.71Suppression of low-frequency noise and vibration

Preset sections with f0 above 0.98·fs/2 are not created when the preset is applied.

Fig. 3. Magnitude response of the “Mains hum suppression” preset, fs = 16,276 Hz.

Application and limitations