0% found this document useful (0 votes)
131 views15 pages

EXP NO:07-a Date: Design of Fir Filter by Windowing Technique

Uploaded by

Poovarasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views15 pages

EXP NO:07-a Date: Design of Fir Filter by Windowing Technique

Uploaded by

Poovarasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

EXP NO :07-a

DESIGN OF FIR FILTER BY WINDOWING TECHNIQUE


DATE:

AIM:
To design the FIR filter by windowing technique using MATLAB software.

APPARATUS REQUIRED:
MATLAB software

THEORY:
In digital signal processing, an FIR is a filter whose impulse response is of finite period, as
a result of it settles to zero in finite time. This is often in distinction to IIR filters, which can have
internal feedback and will still respond indefinitely. The impulse response of Nth order discrete
time FIR filter takes precisely N+1 samples before it then settles to zero. FIR filters are the most
popular kind of filters executed in software and these filters can be continuous time, analog or
digital and discrete time.

WINDOWING TECHNIQUE:

A window is a finite length sequence and is a process of forming a finite length sequence
from an infinite length sequence with the window.

TYPES OF WINDOWING:

1. Rectangular
2. Bartlett
3. Hanning
4. Hamming
5. Blackman
6. Kaiser windowing techniques
OUTPUT OF LOW PASS FILTER:

Enter the number of samples=34


MATLAB CODING FOR LOW PASS FILTER:

clc;
clear all;
close all;
n=input('enter the number of samples: ');
wc=[pi/2];
w=0:0.01:pi;
b=fir1(n,wc/pi,'low',hamming(n+1));
h=freqz(b,1,w);
figure(1);
subplot(2,2,1);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('hamming window');
b=fir1(n,wc/pi,'low',hanning(n+1));
h=freqz(b,1,w);
figure(1);
subplot(2,2,2);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('hanning window');
b=fir1(n,wc/pi,'low',blackman(n+1));
h=freqz(b,1,w);
subplot(2,2,3);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('blackman window');
b=fir1(n,wc/pi,'low',kaiser(n+1));
h=freqz(b,1,w);
subplot(2,2,4);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('kaiser window');
OUTPUT OF HIGH PASS FILTER:

Enter the number of samples=40


MATLAB CODING FOR HIGH PASS FILTER:

clc;
clear all;
close all;
n=input('enter the number of samples: ');
wc=[pi/2];
w=0:0.01:pi;
b=fir1(n,wc/pi,'high',hamming(n+1));
h=freqz(b,1,w);
figure(1);
subplot(2,2,1);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('hamming window');
b=fir1(n,wc/pi,'high',hanning(n+1));
h=freqz(b,1,w);
figure(1);
subplot(2,2,2);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('hanning window');
b=fir1(n,wc/pi,'high',blackman(n+1));
h=freqz(b,1,w);
subplot(2,2,3);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('blackman window');
b=fir1(n,wc/pi,'high',kaiser(n+1));
h=freqz(b,1,w);
subplot(2,2,4);
plot(w/pi,abs(h));
xlabel('frequency');
ylabel('magnitude');
title('kaiser window');
INFERENCE:

DESCRIPTION MARKS AWARDED MARKS OBTAINED


CODING 40
OBSERVATION 30
RECORD 20
VIVA 10
TOTAL 100

RESULT:
Thus the FIR using windowing technique for low pass filter and high pass filter are designed
using MATLAB software and the output is verified.
EXP NO :07-b
DESIGN OF FIR FILTER BY FREQUENCY SAMPLING TECHNIQUE
DATE:

AIM:

To design the FIR filter by using frequency sampling method MATLAB software.

APPARATUS REQUIRED:
MATLAB software .

THEORY:
FIR filters are the most popular kind of filters executed in software and these filters can
be continuous time, analog or digital and discrete time.
In digital signal processing, an FIR is a filter whose impulse response is of finite
period, as a result of it settles to zero in finite time. This is often in distinction to IIR filters,
which can have internal feedback and will still respond indefinitely. The impulse response
of Nth order discrete time FIR filter takes precisely N+1 samples before it then settles to
zero.

FREQUENCY SAMPLING METHOD:

The frequency sampling method or FIR filter design is perhaps the simplest and most
direct technique imaginable when a desired frequency response has been specified. It
consist simply of uniformly sampling the desired frequency response, and performing an
inverse DFT to obtain the corresponding (finite) impulse response.
OUTPUT OF BAND PASS FILTER:
MATLAB CODING FOR BANDPASS FILTER:

clc; clear
all; close
all;
fs=8000;
n=40;
b=fir1(n,[600/2000 1000/2000],'bandpass');
freqz(b,1,128,4000);
figure(1);
xlabel('Frequency(hz)');
ylabel('Magnitude(db)');
title('Bandpass'
OUTPUT OF BAND STOP FILTER:
MATLAB CODING FOR BANDSTOP FILTER:

clc; clear
all; close
all;
fs=8000;
n=40;
b=fir1(n,[1000/3000 1250/3000],'stop');
freqz(b,1,128,6000);
figure(1);
xlabel('Frequency');
ylabel('Magnitude');
title('Bandstop');
INFERENCE:

DESCRIPTION MARKS AWARDED MARKS OBTAINED

CODING 40
OBSERVATION 30
RECORD 20
VIVA 10
TOTAL 100

RESULT:

Thus, the FIR using frequency sampling technique for band pass filter and stop band
filter are designed using MATLAB software and the output is verified.

You might also like