0% found this document useful (0 votes)
218 views4 pages

Chebyshev FIR Filter Design in MATLAB

This document discusses the design of Chebyshev type-1 FIR filters in MATLAB. It provides theory on FIR filters and their properties. The procedure involves running a MATLAB script that designs low pass, high pass, band pass, and band stop FIR filters based on user-specified passband ripple, stopband ripple, frequencies, and sampling frequency. The script calculates filter coefficients, applies the filters, and plots the frequency responses to verify the filters were designed as specified.
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)
218 views4 pages

Chebyshev FIR Filter Design in MATLAB

This document discusses the design of Chebyshev type-1 FIR filters in MATLAB. It provides theory on FIR filters and their properties. The procedure involves running a MATLAB script that designs low pass, high pass, band pass, and band stop FIR filters based on user-specified passband ripple, stopband ripple, frequencies, and sampling frequency. The script calculates filter coefficients, applies the filters, and plots the frequency responses to verify the filters were designed as specified.
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

FIR FILTER DESIGN

AIM: To design chebyshev type-1 fir filter

Low pass filter


High pass filter
Band pass filter
Band stop filter

APPARATUS: System with matlab

THEORY:
In signal processing, a finite impulse response (FIR) filter is a
filter whose impulse response is of finite duration, because it settles to
zero in finite time.
The impulse response of an Nth-order discrete-time FIR filter lasts
exactly N + 1 sample before it then settles to zero.FIR filters can be
discrete-time or continuous-time, and digital or analog.
If an FIR filter is non-causal, the range of nonzero values in its impulse
response can start before n = 0, with the defining formula appropriately
generalized.
An FIR filter has a number of useful properties which sometimes make it
preferable to an infinite impulse response (IIR) filter. FIR filters:

Require no feedback. This means that any rounding errors are not
compounded by summed iterations.

Are inherently stable, since the output is a sum of a finite number of


finite multiples of the input values

Can easily be designed to be linear phase by making the coefficient


sequence symmetric this property is sometimes desired for phasesensitive applications, for example data communications,
seismology, crossover filters, and mastering.

The main disadvantage of FIR filters is that considerably more


computation power in a general purpose processor is required compared

to an IIR filter with similar sharpness or selectivity, especially when low


frequency cutoffs are needed.
An FIR filter is designed by finding the coefficients and filter order that
meet certain specifications, which can be in the time-domain (e.g. a
matched filter) and/or the frequency domain (most common). Matched
filters perform a cross-correlation between the input signal and a known
pulse-shape. The FIR convolution is a cross-correlation between the input
signal and a time-reversed copy of the impulse-response. Therefore, the
matched-filter's impulse response is "designed" by sampling the known
pulse-shape and using those samples in reverse order as the coefficients
of the filters.

PROCEDURE:
To start MATLAB, double-click the MATLAB shortcut
Click on new script .An editor window appears type the program
code in editor window
Save the program code by clicking the save option save the file
name with .m extension
Run the program using the run option icon
Errors if present appear in command window

PROGRAM:
clc;
close all;
clear all;
rp=input('enter the pass band ripple...');
rs=input('enter the stop band ripple...');
fs=input('enter the stop band frequency..');
fp=input('enter the pass band frequency....');
f=input('enter the sampling frequency...');
r=input('enter the ripple value in dB...');
wp=2*fp/f;
ws=2*fs/f;
num=20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem);
if(rem(n,2)==0)

n=n+1;
end
y=chebwin(n,r);
%low pass filter
b=fir1(n-1,wp,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,1);
plot(o/pi,m);
ylabel('gain in db,,,>');
xlabel('(a) normalised frequency...>');
title('low pass filter');
%high pass filter
b=fir1(n-1,wp,'high',y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,2);
plot(o/pi,m);
ylabel('gainin dB...>');
xlabel('(b)normalized frequency...>');
title('high pass filter');
%band pass filter
wn=[wp,ws];
b=fir1(n-1,wn,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,2,3);
plot(o/pi,m);
ylabel('gainin dB...>');
xlabel('(c)normalized frequency...>');
title('band pass filter');
%band stop filter
b=fir1(n-1,wn,'stop',y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(b));
subplot(2,2,4);
plot(o/pi,m);
ylabel('gainin dB...>');
xlabel('(d)normalised freqz...>');
title('stop band filter');

RESULT:
enter the pass band ripple...0.03
enter the stop band ripple...0.02
enter the stop band frequency..2400
enter the pass band frequency....1800
enter the sampling frequency...10000
enter the ripple value in dB...40
The fir of chebshev LPF,HPF,BPF,BSF was simulated using matlab
Hence taken stop band frequency is 2400
pass band frequency is 1800
normalized stopband frequency=2(fs/f)
=(2(2400))/10000
=0.48
Normalized passband frequency=2(fp/f)
=0.36
We observed the normalized cutoff frequencies in the filter output
response.

You might also like