[20] Deconvolution (Inverse Filtering), the Sequel: Using the DFT
- [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.)
- [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.)
- [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))