Introduction Project 2 Project 2: audio equalizer This project aims to motivate our study o ilters by considering the design and implementation o an audio equalizer. An equalizer (EQ) modiies the requency response o an audio system by ampliying or attenuating dierent requency ranges. A simple EQ consists o bass and treble controls as is commonly ound on stereo systems (Fig. ). These are easily implemented with analog ilters. Fig. : Kinter MA-7 stereo ampliier with bass and treble controls. Multiband EQs allow more precise tailoring o the requency response and are oten implemented using DSP (Fig. 2). These are also called graphic EQs because the positions o the slider bars provide a graphical representation o the requency response. Graphic EQs can be used to compensate or room acoustics, microphone or speaker requency resonances, or to tailor sound to a listener s preerences. Fig. 2: DSP-based multiband equalizer. The bandpass ilters are spaced at hal-octave intervals, ( 2 actors). A parametric EQ allows independent adjustment o various parameters such as center requency, bandwidth and gain. EE 464 28-5-4
Lecture 2 Project 2: audio equalizer 2/6 Bass and treble One approach to implementing bass and treble controls (a two-band EQ ) is illustrated in Fig. 3. The input signal is simultaneously lowpass and highpass iltered, the iltered signals are ampliied (or attenuated) as desired, and the results are added to produce the output signal. g treble x(n) highpass lowpass y(n) A literal description o the system is y(n)= g bass h LP (n) x(n)+ g treble h HP (n) x(n) () which requires two convolutions. However, convolution is a linear operation, and we can actor out the input signal y(n)=[ g bass h LP (n)+ g treble h HP (n)] x(n) (2) This is a single convolution o the input with the impulse response Fig. 3: Bass and treble control implemented with lowpass ilter, highpass ilter, bass gain and treble gain. y(n)= h(n) x(n) (3) h (n)= g bass h LP (n)+ g treble h HP (n) (4) This idea extends to an EQ with any number o requency bands. Thereore we can always implement an arbitrary EQ operation with a single convolution. A variation on the EQ ilter is the crossover ilter (Fig. 4). In this case we keep the requency bands separated and send each to its own ampliier and speaker. In a high-quality audio system this is necessary because it is very diicult to build a single speaker that can aithully reproduce the entire audio spectrum. Instead, high-quality speakers are typically designed or a limited requency range, and two or more speakers must be combined in a speaker cabinet to reproduce the entire audio signal. g bass highpass D/A+amp tweeter x(n) lowpass D/A+amp wooer Fig. 4: Two-way crossover ilter. For a two-band EQ or crossover ilter we, somewhat arbitrarily, will take EE 464 28-5-4
Lecture 2 Project 2: audio equalizer 3/6 F c =Hz (5) to be the crossover or cuto requency. With F s = 44.kHz the corresponding digital requency is c = khz =.2268 (6) 44. khz To implement the system o Fig. 3 or Fig. 4 we need to design lowpass and highpass ilters with this cuto requency. Lowpass ilter A lowpass ilter should pass a low-requency signal (signal that changes slowly) and block a high-requency signal (signal that changes rapidly). Let s consider the input At the lowest requency =ω= we have while at the highest requency =/2, ω=π we have A simple ilter that passes (8) and blocks (9) is The requency response o this ilter is illustrated in Fig. 5. x(n)=e j ω n =e j 2 π n (7) x(n)= (8) x(n)=( ) n (9) y(n)= [ x(n)+x(n )] () 2 H ( )= 2 (+e j 2π )=e j π cos(π ) ().9.8.7.6.5.4.3.2. <H(deg) - -2-3 -4-5 -6-7 -8..2.3.4.5..2.3.4.5 EE 464 28-5-4-9 Fig. 5 Frequency response o ilter ().
Lecture 2 Project 2: audio equalizer 4/6 Notice that the phase o the ilter response is linear in H ( )= π (2) Such a ilter is said to be linear phase. This is oten a desirable property. Suppose H ( ) =A( ) and H ( )= 2 π a is a linear-phase response. Then a sinusoidal input to the ilter produces an output cos(2π n) A( )cos(2π n 2πa )= A( )cos(2 π [n a]) (3) that is shited in time by a samples, regardless o requency. The response o () is rather crude. We can achieve an improved response by adding more terms M y(n)= b k x(n k) (4) k= This is the FIR ilter we have discussed previously. The problem then is to determine the coeicients b k that result in the desired response. We will study this problem in detail. An example FIR ilter response is shown in Fig. 6 at let..2.2.8.8.6.6.4.4.2.2..2.3.4.5..2.3.4.5 Fig. 6: Frequency response o (let) FIR lowpass ilter with M =5 and c =. and (right) IIR lowpass ilter with M =N =2. We can also implement IIR ilters M y(n)= k= N b k x(n k) a k y(n k ) (5) k = Typically these allow us to obtain a similar requency response with ewer ilter coeicients (Fig. 6 at right). EE 464 28-5-4
Lecture 2 Project 2: audio equalizer 5/6 Highpass ilter A highpass ilter should block a low-requency signal (signal that changes slowly) and pass a high-requency signal (signal that changes rapidly). Changing () to results in a requency response This is plotted below. y(n)= [ x(n) x(n )] (6) 2 H ( )= 2 ( e j π )= j e j π sin (π ) (7).9.8.7.6.5.4.3.2. <H(deg) 9 8 7 6 5 4 3 2..2.3.4.5 - Fig. 7 Frequency response o ilter (6)...2.3.4.5 As with the lowpass ilter, we can add more ilter coeicients to achieve a more desirable response, either with an FIR or IIR orm. N-band equalizer An N-band equalizer is illustrated in Fig. 8. Here band is isolated using a lowpass ilter while band N is isolated using a highpass ilter. All other bands require a bandpass ilter. The resulting signal is This reduces to with y(n)= g h (n) x(n)+ g 2 h (n) x(n)+ + g N h N (n) x(n) y(n)= h(n) x(n) h (n)= g h (n)+ g 2 h 2 (n)+ g N h N (n) EE 464 28-5-4
Lecture 2 Project 2: audio equalizer 6/6 band N g N x(n) band 2 g 2 y(n) g band As an example, the pass bands o an 8-band ilter are shown in Fig. 9. Bandpass ilter Fig. 8: N-band equalizer. Band is a lowpass ilter, Band N is a highpass ilter, and the rest are bandpass ilters. Each band has independent gain control. There are two approaches to designing a bandpass ilter. One idea is to cascade a lowpass and a highpass ilter with suitably chosen cuto requencies. This can be an attractive option when the passband is relatively large. For narrow-band ilters it is usually advisable to design the entire ilter as a single set o coeicients..2.8.6.4.2-3 -2 - Fig. 9: Pass bands o an 8-band FIR equalizer ( M =882 ). Note logarithmic requency scale. Band edges (in Hz) are: 25, 25, 5, k, 2k, 4k, 8k. EE 464 28-5-4