Академический Документы
Профессиональный Документы
Культура Документы
AIM:
To write the MATLAB program to design FIR filter using various window functions.
APPARATUS REQUIRED:
MATLAB , PC
ALGORITHM:
1. Start the program
2. Get the stop band frequency, pass band frequency, stop band ripple, pass band
ripple and samplingfrequency
3. Give the design specification for all filters
4. obtain the design frequency response of all filters
5. stop the program
THEORY:
A discrete time filter produces a discrete time output sequence, y(n) for discrete time input
sequence, x(n).digital filters i.e FIR depending on the form of unit pulse response of the
system. Here the sequence is of finite duration. The system with impulse response is as
follows:
h(n)=2, In I≤ 4
=0, otherwise
As the above has only a finite number of non-zero terms, it is an FIR system. FIR system has
exact linear phase and it is stable.
PROGRAM:
clc
closeall
clearall
N= input('Enter the value')
fc=input('Enter the cut offfreq')
fsamp=input('enter the samp frequency')
n=0:N-1
a=(N-1)/2;
b=0.000001
wc=2*pi*fc/fsamp;
h=(sin((n-a+b)*wc))./((n-a+b)*pi)
w=rectwin(N)
ha=w.*h'
f=0:0.01:pi
H=freqz(ha,1,f)
plot(f,H)
LOYOLA - ICAM
COLLEGE OF ENGINEERING AND TECHNOLOGY (LICET)
clc
closeall
clearall
N= input('Enter the value')
fc=input('Entr the freq')
fs=input('Entr the samp.freq')
b=0.00000001
a=((N-1)/2);
wc=(2*pi*fc)/fs;
n=0:1:N-1;
h=(((sin ((n-a+b)*pi))-(sin((n-a+b)*wc)))./((n-a+b)*pi))
w= hamming(N)
f=0:0.01:pi
ha=w.*h'
H=freqz(ha,1,f)
plot(f,abs(H))
LOYOLA - ICAM
COLLEGE OF ENGINEERING AND TECHNOLOGY (LICET)