Pages

Wednesday, April 27, 2011

DESIGN FIR LOWPASS FILTER WITH CUTOFF FREQUENCY 0.5*pi using HAMMING WINDOW

clear all;
wcutoff=input('ENTER THE CUT OFF FREQUENCY in radians eg: 0.5*pi--->');
N=input('ENTER THE NUMBEROF SAMPLES eg: N=25--->');
alpha=(N-1)/2;
epso=.001;              %to prevent singularity when n=alphan=0:1:N-1;
hd=sin(wcutoff*(n-alpha+epso))./(pi*(n-alpha+epso));
%expression for FIR Lowpass filter


wr=hamming(N);      %expression for Hamming window
hn=hd.*wr';               %wr'=transpose of wrw=0:0.01:pi;
h=freqz(hn,1,w);       %MATLAB function for frequency response
xlabel('Normalised frequency \omega/\pi');
ylabel('Magnitude');
plot(w/pi,abs(h));     %to plot the graph


CLICK HERE FOR FIR LPF using RECTANGULAR WINDOW

OUTPUT
ENTER THE CUT OFF FREQUENCY in radians eg: 0.5*pi--->0.5*pi
ENTER THE NUMBEROF SAMPLES eg: N=25--->31

PLOT

FIR LOWPASS FILTER USING HAMMING WINDOW

No comments:

Post a Comment