ECE561 DIGITAL SIGNAL PROCESSING

Graphic Equalizer Project

Dr. Russell Hardie

 

1. The Problem

 

This problem entails the design and implementation of a digital 5 channel equalizer for audio signals in MATLAB. The input signal can be any .wav file sampled at CD rate (44.1kHz). The reconstruction (D/C) is to be done using the soundsc() command in MATLAB. The equalizer design will have 5 linear phase FIR bandpass filters in parallel, each followed by a gain constant (the band weight). The output of the 5 filters is then summed to form the final output. Note that since these filters are in parallel, the overall impulse response is simply a weighted sum of the individual impulse responses. This, way the input signal can be filtered once by this overall system impulse response.

 

2. The Filters

 

The CD sampling rate is 44.1 kHz (T=1/44100 seconds). With this in mind the effective continuous frequency responses of your five filters should have center frequencies ranging from 0 to 22.05kHz.  Choose your center frequencies on a logarithmic scale, since this is way in which we perceive frequency. From these center frequencies, determine the appropriate cutoff frequencies for each of the 5 filters. Map these frequencies to the discrete frequency domain using the effective continuous filter relationship  (and ).

 

Use the windowing filter design method to approximate these ideal discrete-time frequency response filters. Design the 5 FIRs to have length of at least M=301. Use both a rectangular window and any other window of your choice (Bartlett for example) for each filter.  I suggest that you write a MATLAB function with input parameters being the discrete lower and upper cut-off frequencies of the ideal filters, the filter length, and a flag indicating the window type.  The output of your function should be the impulse response of your filter.  Note that your filters will include a low pass at the lower end and a high pass at the upper end.  These are simply special cases of a bandpass where one of the cutoffs is either 0 or .

 

Compute the DFT of each impulse response (samples of the DTFT,) and plot these for each of the filters for your own benefit (not to submit). Make sure these all look reasonable. The rectangular window should have the most ripple, but the sharpest transition band.

 

Once your impulse responses are in your MATLAB workspace, you are ready to use the MATLAB function I created called 'equalizer'. This function creates a graphic equalizer display and overall effective frequency response.  The inputs are a 1D input array (sound data), five impulse response arrays, and the sampling frequency.  This function and its necessary related files can be found at:

ftp://ftp.engr.udayton.edu/rhardie/ECE561/Equalizer/

Copy the entire Equalizer directory.  You can use 'runequalizer' to see how to load a .wav file and process it with 'equalizer'.  Experiment with 'equalizer' to find a setting you like.  Does this seem to match your expectations? 

 

Note the slider values range from 0 to 1.  Try setting them to [1, 2/3, 1/3, 2/3, 1] and listen to the output and note the overall effective frequency response.  Now, write your own script file to process the signal with the fixed settings above. Here you must manually combine the 5 impulse responses into a single one by performing a weighted average of the individual impulse responses.  Then use the 'conv' command to process the signal with this overall impulse response. Use the 'soundsc' command to verify the output sounds like that produced by 'equalizer'.

 

3. What to Include

 

You should include the following in your report:

 

  • A block diagram of the overall equalizer system.  Indicate the desired filter cut-off frequencies for each bandpass filter. 

 

  • MATLAB generated stem plot of your middle bandpass filter impulse response properly labeled. One for a rectangular window, one for some other window function (total of 2 stem plots for this section).

 

  • For your middle bandpass, include a single plot showing 3 curves (use a legend and different line types).  One curve will be the ideal effective magnitude frequency response, another should be the effective magnitude frequency response of the FIR with a rectangular window, and the last being the effective magnitude frequency response of the FIR with the alternative window. These plots should be versus f (Hertz) for a range - fs/2 to fs/2. To get the frequency responses, you may use the 'fft', 'fftshift', and 'abs' commands to yield samples of  (then label the frequency axis appropriately for your effective frequency responses).  Zero pad the impulse response to 1024 to get a high resolution plot. That is, use H=abs(fftshift(fft(h,1024)));. Make sure you label the frequency axis properly. Comment on the ripple and transition bands of the two FIR filters.

 

  • Present mathematical development detailing the windowing method design process used for a generic bandpass filter with lower cutoff  and upper cutoff . Show just the critical steps and equations for this filter design. 

 

  • Plot of the overall effective frequency response for the system with filter gains of [1, 2/3, 1/3, 2/3, 1].  Compute this with your own script file (not equalizer.m).

 

 

  • Show a spectrogram of the input and output signals using the settings above.

 

  • Put you MATLAB code in an appendix.  This should include a script file for designing the filters, processing the sound file for the filter gains of [1, 2/3, 1/3, 2/3, 1], and generating all of the plots in your report.

 

 

4. Write Up

 

This may be submitted as an informal project report.  Make sure to include all of the results above.  All figures should have a figure number and a short caption describing it.  All figures must be labeled completely and have proper legends as needed.  The body of your text should be contiguous (approximately 1-2 pages).  It should refer to each figure by number and explain it clearly.  Capitalize the work “figure” when referring to a specific figure by number.  You must also integrate the calculations and equations required above into the body of your text (in complete sentences).  Enter equations using the equation editor.  See the notation convention page.