COE4TL4 Lab3 PDF
COE4TL4 Lab3 PDF
COE4TL4 Lab3 PDF
=
otherwise
n
n x
, 0
15 0 , 1
] [
with N = 16, 32, 64, 128 and 256.
c. Describe what happens to the magnitude of the output as the zero-padding at the tail end of the
rectangular signal increases in length.
d. Use the function that you created in Lab #2 to compute and plot the DTFT of the same input set.
What frequency vector w do you need to provide as input to the DTFT function to return the
same outputs as the DFT?
e. Use the built-in MATLAB command for the Fast Fourier Transform fft() to compute the DFT
for the input set. Compare the results of these three Fourier transform methods.
Dr. Ian C. Bruce October 9, 2003 Page 2 of 3
Dr. Ian C. Bruce October 9, 2003 Page 3 of 3
3. DFT Resolution:
a. Load the .wav file aaa.wav. This is a synthesized vowel /A/. What is the sampling
frequency?
b. Plot the waveform (i.e., in time-domain) of the first 300 samples. You should see a natural
repetition. What is the period of this natural repetition?
c. Take the magnitude of the DFT of one natural period and compare it with that of two natural
periods. How does the spectrum change?
d. Zero-pad the same two signal pieces to 1024 points and plot the magnitude of the DFTs. From
section 2 above, zero-padding should change the frequency sampling resolution. Is the
frequency sampling resolution changing as you would expect?
e. Compute and plot the magnitude of the DFT of the signal windowed at 1, 2, 3, 4 and 5 times
the natural period. Using your knowledge of the effects of windowing on spectral resolution,
explain the change in the spectrum due to an increase in the number of samples used to
compute the DFT.
4. Aliasing:
You will be using the same wavefile as section 3, aaa.wav.
a. Listen to the sound. Discard every second sample then duplicate the resulting array (i.e.,
concatenate the array at the end of itself) to make an output.wav which is the same length
as aaa.wav resampled at the original sampling rate. Play output.wav. Describe any
differences that you hear.
b. Plot the magnitudes of the DFTs of aaa.wav and output.wav. Are there any similarities
and/or differences in the spectrums?
c. Can you derive a prediction of the DFT of output.wav by shifting and combining the DFT
of aaa.wav according to downsampling theory?
Potentially useful MATLAB commands
Note that this is not an exhaustive list! You are not required to incorporate all of these in your scripts.
help <topic> helpwin figure plot stem
hist subplot hold on xlabel ylabel
legend title function clear close
clc imread double imagesc colormap
conv conv2 upsample downsample interp1q
interp2 repmat if for end
size zeros ones abs sum
fft fftshift soundsc wavread wavwrite