Starting from:
$30

$24

Digital Signal and Image Processing - Multi-Rate Processing Solution

Name (Print):










Objectives




This programming assignment has three objectives:




Give you practice in using a program to perform digital signal processing.



Help to solidify your understanding of multi-rate processing, and in particular the concepts of decima-tion and interpolation.



Determine the speci cations required for a digital lter.



Instructions




Use a sample rate conversion of ML = 32 for this assignment.



The program should be written in C or C++. No external libraries should be used { you are writing the entire convolution from scratch.



Use the .wav le ghostbustersray.wav to test your program. This le is available on Canvas and is sampled at 11,025 Hz.



Use the Matlab tool fdatool to design your FIR lter.



For all of the frequency response plots, the normalized frequency running along the x-axis in your plot should be scaled to units of cycles/sample and should cover the range from 0 to 1.



For all of the magnitude frequency response plots, the y-axis should be scaled to units of dB by computing (20 log10 jH(f)j).



Write out both the nal processed results in a .wav le for the TA to listen to. Make sure the samples are scaled high enough so that the signal can be played back with a comfortable volume level. Upload the les with your report.



Include your work, answers, plots, and code within a .pdf document report and upload to the Canvas website. Include your observations and any other appropriate comments. The report should include an introduction, a section describing your approach and ndings, and a conclusion.












Design a linear phase FIR low-pass (prototype) lter H(z) to be used in your sample-rate converter. Be sure that the cuto of the lter is appropriate for the conversion.



Plot the impulse response h(n) of the lter.



Plot the magnitude and phase response.



What is the length of the lter?



What method did you use to design the lter?



What are the pass-band and stop-band edge frequencies in the lter you designed?






1









What is the size of the ripple in the pass-band (make this small 0:001 dB)?



What is the peak side-lobe level (in dB) (make this 80 dB)?



Using the simple and noble identities, derive the signal ow graph for a polyphase lter that can change your sample rate by a factor of 32 using the minimum number of operations/sample. Draw the nal signal ow graph that will be implemented in your program. Assume an input sample rate of 11.025 kHz.



What is the nal sample rate of the output?



What is the number of operations (multiplies and adds) required per input sample time?



If the prototype lter had an impulse response h(n) of length K, show how you would separate the coe cients to the M L polyphase type lters Rl;m(z); l = 0; : : : ; L; m = 0; : : : ; M.



In C or C++, write code to implement the straightforward realization for interpolation ( ML ) by up-sampling by L, ltering with the low-pass lter with response H(z), and downsampling by M. Your program should be able to handle any length signal (possibly in nite) without bu ering the entire signal rst. Then do the following.



Generate a cosine signal with frequency f0, x(n) = cos(2 f0n) for n = 0; 1; ; N 1. Let N be chosen so that it is at least 30 times the length of the h(n) lter. If possible, let N be 100 times longer than the length of your prototype lter. Pass x(n) through the interpolator. Let y(n) be the output.



Plot the 512-point DFT magnitude of x(n) and y(n) on the same plot.



Repeat this for each of the frequencies f0 in the table below. Record in the table the frequency f^0 of the interpolated signal found from the DFT.



f0 f^0




1

16




1

8




1

4




In C or C++, write code to implement the polyphase lter bank realization from part 2 above for interpolation (by ML ) using the low-pass lter with response H(z). Your program should be able to handle any length signal (possibly in nite) without bu ering the entire signal rst. Then repeat 4(a){(c).






f0 f^0







1

16




1

8




1

4




Use the Matlab function wavread() to generate the samples of the le ghostbustersray.wav. Inter-polate the signal using your programs from parts 4 and 5. Import the resulting les back into Matlab, and play the original signal (using sound()) at a sampling rate of 11,025 Hz, and the processed signals from both methods at the interpolated sample rate. Do they all sound the same? To pass this o , have the TA listen and con rm your results.



Write out the nal processed results in a .wav le for the instructor to listen to. Make sure the samples are scaled high enough so that the signal can be played back with a comfortable volume level. Upload the les with your report.







2

More products