Homework Eleven
- Reading: Chapter 5, Chapter 10
- Homework:
- Problem 5.1-5
- Problem 5.1-9
- Problem 5.1-10
- Problem 10.6-6
- This exercise is to be in conjunction with MATLAB.
Let
. This is not a bandlimited signal. Let
. In this problem you will explore the DFT for
various combinations of sampling rates and zero padding.- Make a plot of
for
< f < 5$" align="middle" border="0" height="30" width="72" />
Hz. (where
.) For example,
freqrange = 0:.1:5; % make the range of frequency variables Xf = 1 ./ sqrt((2*pi*freqrange).^2 + 1); % magnitude Fourier tranform plot(freqrange,Xf); % plot F.T.
You should overlay this plot over every spectrum computed below for comparison.
- Let
be the sampling interval (i.e.,
). Let
, and sample 128 points of the function. Then plot the FFT
of the sampled data:
N0=128; % number of sample points T = 0.1; % sample interval Fs = 1/T; % sample rate k = (0:(N0-1)); % index range k_2 = (0:(N0/2-1)); % half the points x = T*exp(-(k*T)); % the sampled function. (Scale by T) xout = fft(x,N0); % compute the FFT plot(k_2*Fs/N0, abs(xout(1:(N0/2))),'-',freqrange, Xf,':'); % plot sampled spectrum and true spectrum % Note: the factor fs/N0 converts from bin number to frequency in Hz.Print the plot. Comment on discrepancies between the true spectrum and the spectrum computed by the DFT. - Now try some variations.
- Take 128 point of data, with zero-pad to 512 points.
- Take 128 points of data, with
. - Take 128 points of data, with
. - Take 512 points of data, with

- Take 512 points of data, with

- Make a plot of
- Cyclic convolution. Let
and let
![\begin{displaymath}x[k] =
\begin{cases}
1 & 0 \leq k \leq 16 \\
0 & \text{otherwise}
\end{cases}\end{displaymath}](hw11img11.png)
![\begin{displaymath}y[k] =
\begin{cases}
k & 0 \leq k \leq 8 \\
16-k & 8 \leq k \leq 16 \\
0 & \text{otherwise}
\end{cases}\end{displaymath}](hw11img12.png)
- Using MATLAB, find the linear convolution of
and
:
x = ones(1,16); % set up x data y = [1 2 3 4 5 6 7 8 7 6 5 4 3 2 1]; % set up y data z = conv(x,y); % convolve stem(0:length(z)-1,z); % plot the convolved results
- Now test the convolution theorem by taking transforms of the
signals:
X = fft(x,32); % take the DFT of x data Y = fft(y,32); % take the DFT of y data Z = X .* Y; % Multiply. .* is point-for-point multiply znew = real(ifft(Z,32)); % compute the inverse transform % use real() to get rid of the imaginary part % (which should be very small) stem(0:length(znew)-1,znew); % plot the convolution. - Compare the plot from part (a) with the plot from part (b).
- Now we will examine cyclical convolution by dealing with 16
point FFTs.
X1 = fft(x,16); Y1 = fft(y,16); Z1 = X1 .* Y1; z1 = ifft(Z1,16); stem(0:15, real(z1));
Using cyclical convolution, account for this strange result.
- Using MATLAB, find the linear convolution of
Copyright 2008,
by the Contributing Authors.
Cite/attribute Resource.
admin. (2006, June 14). Homework Eleven. Retrieved November 23, 2009, from Free Online Course Materials — USU OpenCourseWare Web site: http://ocw.usu.edu/Electrical_and_Computer_Engineering/Signals_and_Systems/hw11.html.
This work is licensed under a
Creative Commons License.







