Blogger Widgets

Wednesday, 18 April 2012

FIR Filter Design by Windowing Technique :-

Matlab Code:
clc;
clear all;
close all;
N=input('Enter period N=');
x=rand(1,N);
w=pi/4;
a=(N-1)/2;
for i=1:N
if(i==a)
hd(i)=w/pi;
else
hd(i)=sin(w*(i-a))/((i-a)*pi);
end
end
y=cconv(x,hd);
p=fvtool(x);

title('Mag. Response of x in dB');
q=fvtool(hd);

title('Mag. Response of hd in dB');
r=fvtool(y);
title('Freq. Response of FIR Filter with Rectangular Window');


Figure:

0 comments

Post a Comment