You are on page 1of 1

%Frequency Sampling Design Example

%Simple Coding Version


%Lowpass filter with wc=2pi/5
%Select M
M=5;
Dw=2*pi/5; %Find frequency spacing
g=(M-1)/2; %group delay
t=-i*g*2*pi/M;
Hd1=[1.0*exp(t*0),0.7*exp(t*1),0.0*exp(t*2),0.0*exp(t*3),0.7*exp(t*4)];
h=ifft(Hd1);
w=linspace(0,2,1000)*pi;
[H,w]=freqz(h,1,w);
Hm=abs(H);
%Plot:
figure(1)
plot(w/pi,Hm,(0:M-1)/M*2,[1 .7 0 0 .7],'.r');
xlabel('\omega/\pi')
ylabel('Magnitude')
title('Simple version; Magnitude Response')

You might also like