EECS 451______________________PROBLEM SET #7______________________Fall 2009

ASSIGNED: Oct. 29, 2009. 1996 Text: Sections 6.1-6.2 on FFT.
DUE DATE: Nov. 5, 2009. 2007 Text: Sections 8.1; 8.2.1-8.2.3.

    Basic properties of the discrete Fourier transform (DFT):
  1. [25] Compute the circular convolution of the two sequences {1,2,3,1} and {4,3,2,2}:
    (a) [10] Directly in the time domain; (b) [15] Using the 4-point DFT (uses less computation).
    [1996 Text: #5.8-9]. Same circular convolution directly and by using a 4-point DFT.
    [2007 Text: #7.8-9]. Latter method requires only 4 complex multiplications and divisions by 4.
    straightforward but may take awhile. Circular convolutions: page 418[1996]; 473[2007].
  2. [10] (2@5) x(n) is real and periodic with even period=N, and x(n+N/2)=-x(n) for n=0,1...N/2-1.
    (a) Show the N-point DFT X(k) of x(n) has X(k)=0 for even values of k (only odd harmonics).
    (b) Show how to compute X(k) from x(n) using the N/2-point DFT of a modulated x(n).
    [Text: 1996: #5.20. 2007: #7.20]. Example of x(n): {3,1,4,1,5,9,-3,-1,-4,-1,-5,-9}.
    Why this problem? This is how the radix-2 decimation-in-frequency FFT works.
  3. [15] Compute the 4-point DFT of {1,2,3,1} by writing out the DTFS of its periodic extension
    and solving a 4×4 linear system with unknowns [X(0) X(1) X(2) X(3)]' and right side [1 2 3 1]'.
    [Text: 1996: #5.24a. 2007: #7.24a]. First done above in #1. DFT is a linear transformation.
  4. [10] Let X(k) be the z-transform of x(n)=u(n)-u(n-7) evaluated at z=exp(j2πkn/5) for k=0,1,2,3,4.
    Determine the inverse 5-point DFT of {X(0),X(1),X(2),X(3),X(4)}. DON'T compute it directly!
    [Text 1996: #6.5. 2007: #8.5]. Aliasing due to undersampling, but now in time domain!
    Both editions for this problem should read: X(k)=X(z)|z=ej2πk/5, k=0,1,2,3,4.

    Applications of the discrete Fourier transform:
  5. [20] We compute y(n)=h(n)*u(n) using y(n)=DFT-1{DFT{x(n)}DFT{u(n)}}. Both h(n) and u(n)
    are real. Show how to compute the DFTs of both h(n) and u(n) using only one complex DFT.
    HINT: Compute DFT[h(n)+ju(n)], break up both h(n) and u(n) into their even and odd functions,
    and use (again!) DFT[real and even]=real and even; DFT[real and odd]=pure imaginary and odd.
    Use this trick to convolve real sequences; this problem is actually solved in the text.
  6. [20] Deconvolution (Inverse Filtering), the Sequel: Using the DFT
    1. [0] The 1st 3 lines below add reverb to Handel (much more of it than in Problem Set #4).
      Note how the 2nd line implements upsampling (inserting zeros into a signal).
      Listen to Y using sound(Y). Can you make any sense out of it? (I can't, anyway.)
    2. [10] Suppose you didn't know how many echoes of the original signal are added to it.
      Look at the spectrum of Y in the 2ndplot. Explain how it tells you how many echoes.
      HINT: Peaks in the spectrum must come from poles of H(z) near the unit circle!
      (The 3rd and 4th plots really tell you, of course, but pretend you don't have them.)
    3. [10] Show we have successfully used the DFT to perform deconvolution (inverse filtering).
      Explain when this procedure will break down. HINT: what if we change 0.97 to 1.00?
    clear;load handel;X=(y(27001:31096))';%Can you Handel this again?
    HH(2:1024)=0.97.^[0:1022];HH(4,1024)=0;H=(HH(:))';%What am I doing?
    YY=conv(H,X);Y=YY(1:4096);%Reverbed signal;conv takes awhile here.
    
    FX=fft(X);FY=fft(Y);FH=fft(H);FZ=FY./FH;Z=real(ifft(FZ));N=[1:4000];
    subplot(3,2,1),plot(N,Y(N));subplot(3,2,2),plot(N,abs(FY(N)))
    subplot(3,2,3),plot(N,H(N));subplot(3,2,4),plot(N,abs(FH(N)))
    subplot(3,2,5),plot(N,Z(N));subplot(3,2,6),plot(N,Z(N)-X(N))