638 C H A P T E R 10: Fourier Analysis of Discrete-Time Signals and Systems
be of the same length asY[k](i.e., bigger or equal toM+N− 1 ). Consider what happens when the filter
is an IIR that possibly has an impulse response of very large length. Let
y[n]−1.755y[n−1]+0.81y[n−2]=x[n]+0.5x[n−1]
be the difference equation representing an IIR filter with inputx[n]and outputy[n]. Assume the initial
conditions are zero, and the input isx[n]=u[n]−u[n−50]. Use MATLAB to obtain your results.
(a) Compute usingfilterthe first 40 values of the impulse responseh[n]and use them to approximate
it (call ithˆ[n]). Compute the filter outputˆy[n]using the FFT as indicated above. In this case, we are
approximating the IIR filter by an FIR filter of length 40. Plot the input and the output. Use FFTs of
length 128.
(b) Suppose now that we do not want to approximateh[n], so consider the following procedure. Find
the transfer function of the IIR filter, sayH(z)=B(z)/A(z), and ifX(z)is the Z-transform of the input,
then
Y(z)=
B(z)X(z)
A(z)
Compute as before the FFT forx[n], of length 128 (call itX[k]) and compute the 128 length of the
coefficients ofB(z)andA(z)to obtain DFTsB[k]andA[k]. MultiplyingX[k]byB[k]and dividing by
A[k], all of length 128, results in a sequence of length 128 that should correspond toY[k], the DFT of
y[n]. Compute the inverse FFT to gety[n].
(c) Usefilterto solve the difference equation and obtainy[n]forx[n]=u[n]−u[n−50]. If this is the
exact solution, calculate the error with respect to the other responses in (a) and (b)?
10.29. Circular and linear convolutions—MATLAB
Consider the circular convolution of two signalsx[n]=n, 0 ≤n≤ 3 , andy[n]= 1 ,n=0, 2and zero for
n=1, 3.
(a) Compute the convolution sum or linear convolution ofx[n]andy[n]. Do it graphically and verify your
results by multiplying the DTFTs ofx[n]andy[n].
(b) Use MATLAB to find the linear convolution. Plotx[n],y[n], and the linear convolutionz[n]=(x∗
y)[n].
(c) We wish to compute the circular convolution ofx[n]andy[n]for different lengthsN= 4 ,N= 7 , and
N= 10. Determine for which of these values does the circular and the linear convolutions coincide.
Show the circular convolution for the three cases. Use MATLAB to verify your results.
(d) If we use the convolution property of the DFT verify your result in the above parts of this problem.