% frequency repsonse for pure exponentials % set parmeters and signal N = 128; k = 8; t = (0:(N-1))/N; I = sqrt(-1) E = exp(2*pi*I*k*t); % set filter and convolve L = [1,2,3,2,1]/9; n = size(L,2) LE = circconv(E,L); % show signal filter and convolved signal; figure(1) subplot(3,1,1) plot(t,real(E),'r-'); axis([0,1,-1.5,1.5]); title('real parts of original signal') subplot(3,1,2) plot(t,imag(E),'g-'); axis([0,1,-1.5,1.5]); title('imaginary part of original signal') subplot(3,1,3) stem(0:(n-1),L,'filled') title('filter in stem plot form'); disp('Press a key for filtered wave forms') pause subplot(3,1,1) plot(t,real(E),'r-',t,real(LE),'r-.' ); axis([0,1,-1.5,1.5]); title('real part of original signal and filetered signal') subplot(3,1,2) plot(t,imag(E),'g-',t,imag(LE),'g-.' ); axis([0,1,-1.5,1.5]); title('imaginary parts of original signal and filetered signal')