In this matlab exercise we will explore downsampling and


In this MATLAB exercise, we will explore downsampling and upsampling a discrete-time signal corresponding to a piece of music. To start, type load handel. In your workspace, you should now have a vector y of length 73113. Play this piece of music using sound(y).

(a) Compute the DFT of y and plot its magnitude. For all DFTs in this problem use an f ft of size length Cy).

(b) Write a simple piece of code to downsample y by 2. This should generate a vector yds of length 36557, composing of just the odd-indexed (in MATLAB terminology) elements of y. Compute and plot the DFT of yds. How does that compare to the DFT of y? Play yds using sound(yds). In what way does this piece of music differ from the original?

(c) Now let us start the process of upsampling yds. Insert zeros between every pair of samples of yds. This should generate a vector yusl of length 73113. Play this signal and comment on what you hear. Plot the magnitude of its DFT. How does this spectrum compare with the previous spectra?

(d) Now let us complete the upsampling process by applying an ideal low-pass filter on yust Use an ideal filter that passes all frequencies smaller in magnitude than 7r/2. Call the resulting signal yus. Play yus and compare what you hear with all the previous signals you heard. Plot the magnitude of the DFT of yus. Compare this spectrum with the previous spectra. Do the spectra you have plotted in this exercise agree with what you have learned in class about the spectra associated with upsampling and downsampling operations? Explain.

Attachment:- 545251_1_audio-upsampling-example.m

Solution Preview :

Prepared by a verified Expert
MATLAB Programming: In this matlab exercise we will explore downsampling and
Reference No:- TGS01150619

Now Priced at $60 (50% Discount)

Recommended (97%)

Rated (4.9/5)

A

Anonymous user

5/21/2016 1:48:04 AM

For this MATLAB exercise, we will discover down-sampling and up-sampling a discrete-time signal corresponding to the piece of music. To begin, type load handel. In your workspace, you must now encompass a vector y of length 73113. Play this piece of music employing sound(y). a) Calculate the DFT of y and plot its magnitude. For all the DFTs in this problem make use of an f ft of size length (y). b) Write down a simple piece of code to down sample y by 2. This must produce vector yds of length 36557, create of just the odd-indexed (in MATLAB terminology) elements of y. Calculate and plot the DFT of yds. Illustrate how does that compare to the DFT of y? Play yds employing sound(yds). In what manner does this piece of music distinct from the original?