Skip to main content
留学咨询

辅导案例-EECS 152B-Assignment 4

By May 15, 2020No Comments

EECS 152B Winter 2020 Assignment 4 Due: Fri. Feb. 28 This lab involves sample rate conversion. In the following, if you are told to “upsample” a signal by a factor N , it means the combined operation of inserting N − 1 zeros between each existing sample and then interpolating using a low-pass filter. If you are told to “decimate” or “downsample” a signal by a factor of N , it means (unless you are told otherwise) the combined operation of passing the signal through a low-pass anti-aliasing filter, and then keeping only every N -th sample. In all cases below, when needed use low-pass filters of length 101 generated using fir1 with the default Hamming window. 1. Show how to generate samples of a 1000Hz sinewave that is sampled at 20kHz. Play the tone in Matlab using the sound command to get an idea of what it sounds like. 2. Upsample the sinewave to 80kHz. Listen to the signal after you have inserted the zeros and then after you perform the interpolation, and describe the results. Plot samples of the waveform before and after upsampling, ensuring that the time axis corresponds to real time (e.g., seconds) and not sample time. Are the waveforms the same? Explain. 3. Downsample the original sinewave to 5kHz, with and without the anti-aliasing filter. Does the anti- aliasing filter make a significant difference in this case? Why or why not? Again plot the original and downsampled signal using real time on the horizontal axis, and explain any differences. 4. Predict what would happen if you kept only one of every 12 samples of the original sinewave, without using any low-pass filter. Be as precise as possible. Then listen to the result and see if you were correct. 5. Load the file tchaikovsky.mat from the Matlab Files module on Canvas, which contains a portion of Tchaikovsky’s famous “Dance of the Sugar Plum Fairy” sampled at 44.1kHz. (a) Downsample the file by factors of 56 , 2 3 , 1 2 , 1 3 and 1 6 , and describe how the quality of the music clip changes. For the cases of 12 , 1 3 and 1 6 , downsample without using the low-pass filter. How important is the anti-aliasing filter? (b) Upsample the file by factors of 32 , 9 2 and 21 2 and describe the results. (You should only perform the upsampling on a portion of the file to prevent it from becoming too large, since otherwise Matlab may run out of memory). (c) Repeat part (b) using a linear interpolator rather than a low-pass filter interpolator. How good is the resulting sound quality?

admin

Author admin

More posts by admin