#### Naveed Ahmed

##### Member level 4

I have written a test program in matlab for lowpass fir, when i m plotting its magnitude response after fft, it seems to be a high pass filter. Why its doing so??

My code is as follow:

N=50; %Filter order

Length=N+1; %length

n0=N/2; %delay parameter

n=0:1:N;

fc_l=1/8; %Cut off frequency for the low pass filter

Wc_l=2*pi*fc_l;

%===================LOWPASS FIR FILTER=====

h_lp=sin(Wc_l*(n-n0)) ./(pi*(n-n0)); %Impulse response of Low Pass FIR filter For n-n0!=0

h_lp(n0+1)=(Wc_l/pi) %Imp response of Low Pass FIR filter For n=n0 or n-n=0

F=fft(h_lp,51);

X=real(F);

Y=imag(F);

[th,Mag]=cart2pol(X,Y);

plot(0:50,Mag)

Thanks,

Your comments plz

naveed