2.3 Equalizers

Introduction and Musical Applications

In contrast to low/highpass and bandpass/reject filters, which attenuate the audio spectrum above or below a cut-off frequency, equalizers shape the audio spectrum by enhancing certain frequency bands while others remain unaffected. They are typically built by a series connection of first- and second-order shelving and peak filters, which are controlled independently (see Figure 2.15). Shelving filters boost or cut the low- or high-frequency bands with the parameters cut-off frequency fc and gain G. Peak filters boost or cut mid-frequency bands with parameters center frequency fc, bandwidth fb and gain G. One often-used filter type is the constant Q peak filter. The Q factor is defined by the ratio of the bandwidth to center frequency images/c02_I0046.gif. The center frequency of peak filters is then tuned while keeping the Q factor constant. This means that the bandwidth is increased when the center frequency is increased and vice versa. Several proposed digital filter structures for shelving and peak filters can be found in the literature [Whi86, RM87, Dut89a, HB93, Bri94, Orf96, Orf97, Zöl05].

Figure 2.15 Series connection of shelving and peak filters.

2.15

Applications of these parametric filters can be found in parametric equalizers, octave equalizers (fc = 31.25, 62.5, 125, 250, 500, 1000, 2000, 4000, 8000, 16 000 Hz) and all kinds of equalization devices in mixing consoles, outboard equipment and foot-pedal controlled stomp boxes.

2.3.1 Shelving Filters

First-order Design

Similar to the first-order lowpass/highpass filters described in Section 2.2.5, first-order low/high frequency shelving filters can be constructed based on a first-order allpass [Zöl05], yielding the transfer function

2.40 2.40

with the first-order allpass

2.41 2.41

The block diagram in Figure 2.16 shows a first-order low/high-frequency shelving filter, which leads to the difference equations

2.42 2.42

2.43 2.43

2.44 2.44

The gain G in dB for low/high frequencies can be adjusted by the parameter

2.45 2.45

The cut-off frequency parameters, cB for boost and cC for cut, for a first-order low-frequency shelving filter can be calculated [Zöl05] as

2.46 2.46

2.47 2.47

and for a high-frequency shelving filter as

images/c02_I0055.gif

An implementation of this approach is given in M-file 2.3

M-file 2.3 (lowshelving.m)

function y = lowshelving (x, Wc, G)

% y = lowshelving (x, Wc, G)

% Author: M. Holters

% Applies a low-frequency shelving filter to the input signal x.

% Wc is the normalized cut-off frequency 0<Wc<1, i.e. 2*fc/fS

% G is the gain in dB

V0 = 10(G/20); H0 = V0 - 1;

if G > = 0

  c = (tan(pi*Wc/2)-1) / (tan(pi*Wc/2)+1);     % boost

else

  c = (tan(pi*Wc/2)-V0) / (tan(pi*Wc/2)+V0);   % cut

end;

xh = 0;

for n = 1:length(x)

  xh_new = x(n) - c*xh;

  ap_y = c * xh_new + xh;

  xh = xh_new;

  y(n) = 0.5 * H0 * (x(n) + ap_y) + x(n);  % change to minus for HS

end;

Figure 2.16 First-order low/high-frequency shelving filter.

2.16

Magnitude responses for a low-frequency shelving filter are illustrated in the left part of Figure 2.17 for several cut-off frequencies and gain factors. The slope of the frequency curves for these first-order filters are 6 dB per octave.

Figure 2.17 Frequency responses for first-order and second-order shelving filters.

2.17

Higher-order Designs

For several applications, especially in advanced equalizer designs, the slope of the shelving filter is further increased by second-order or even higher-order transfer functions. There are several approaches for designing higher-order shelving filters with relatively simple computation of the coefficients at the cost of slightly more complicated filter structures [KZ04, Orf05, HZ06].

Design formulas for canonical second-order shelving filters are given in Table 2.3 from [Zöl05]. Their magnitude responses are illustrated in the right part of Figure 2.17 for two cut-off frequencies and several gain factors.

Table 2.3 Second-order shelving filter design with images/c02_I0100.gif and V0 = 10G/20 [Zöl05]

NumberTable

2.3.2 Peak Filters

Similarly, a second-order peak filter [Zöl05] is given by the transfer function

2.48 2.48

where

2.49 2.49

is a second-order allpass filter. The block diagram in Figure 2.18 shows the second-order peak filter, which leads to the difference equations

2.50 2.50

2.51 2.51

2.52 2.52

The center frequency parameter d and the coefficient H0 are given by

2.53 2.53

2.54 2.54

2.55 2.55

The bandwidth fb is adjusted through the parameters cB and cC for boost and cut given by

2.56 2.56

2.57 2.57

A possible peak filter implementation using this approach is given in M-file 2.4.

M-file 2.4 (peakfilt.m)

function y = peakfilt (x, Wc, Wb, G)

% y = peakfilt (x, Wc, Wb, G)

% Author: M. Holters

% Applies a peak filter to the input signal x.

% Wc is the normalized center frequency 0<Wc<1, i.e. 2*fc/fS.

% Wb is the normalized bandwidth 0<Wb<1, i.e. 2*fb/fS.

% G is the gain in dB.

V0 = 10(G/20); H0 = V0 - 1;

if G >= 0

  c = (tan(pi*Wb/2)-1) / (tan(pi*Wb/2)+1);     % boost

else

  c = (tan(pi*Wb/2)-V0) / (tan(pi*Wb/2)+V0);   % cut

end;

d = -cos(pi*Wc);

xh = [0, 0];

for n = 1:length(x)

  xh_new = x(n) - d*(1-c)*xh(1) + c*xh(2);

  ap_y = -c * xh_new + d*(1-c)*xh(1) + xh(2);

  xh = [xh_new, xh(1)];

  y(n) = 0.5 * H0 * (x(n) - ap_y) + x(n);

end;

Figure 2.18 Second-order peak filter.

2.18

This peak filter offers almost independent control of all three musical parameters center frequency, bandwidth and gain. Another design approach from [Zöl05] shown in Table 2.4 allows direct computation of the five coefficients for a second-order transfer function as given in the difference equation (2.2).

Table 2.4 Peak filter design with images/c02_I0121.gif and V0 = 10G/20 [Zöl05]

NumberTable

Frequency responses for several settings of a peak filter are shown in Figure 2.19. The left part shows a variation of the gain with a fixed center frequency and bandwidth. The right part shows for fixed gain and center frequency a variation of the bandwidth or Q factor.

Figure 2.19 Frequency responses second-order peak filters.

2.19
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.227.82