Upload
sam-atkinson
View
214
Download
0
Embed Size (px)
DESCRIPTION
Digital signal processing manual
Citation preview
Experiment 7
Aim: Study of FIR filter design using window method: Bandpass and Bandstop filter.
Software Required: MATLAB 2013a
THEORY:
FIR filters are digital filters with finite impulse response. They are also known as non-
recursive digital filters as they do not have the feedback (a recursive part of a filter), even
though recursive algorithms can be used for FIR filter realization.
A bandpass filter is an electronic device or circuit that allows signals between two specific
frequencies to pass, but that discriminates against signals at other frequencies. In signal
processing, a band-stop filter or band-rejection filter is afilter that passes most
frequencies unaltered, but attenuates those in a specific range to very low levels. It is the
opposite of a band-pass filter. A notch filter is a band-stop filter with a narrow
stopband (high Q factor).
A passband is the range of frequencies or wavelengths that can passthrough a filter. A
bandpass-filtered signal (that is, a signal with energy only in a passband), is known as a
bandpass signal contrary to a baseband signal.
ALGORITHM/PROCEDURE:
1. Start the program
2. Get the inputs for signal generation
3. Use the appropriate library function
4. Display the result
SOURCE CODE :
%fir filter using window technique clc; clear all; close all; rp = input('Enter the passsband ripple '); rs = input('Enter the stopband ripple '); fp = input('Enter the passsband frequency '); fs = input('Enter the stopband frequency '); f = input('Enter the sampling frequency '); 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); n1 = n + 1; if (rem(n,2) ~= 0) n1=n; n = n-1; end y = boxcar(n1); %Band pass filter wn = [wp ws]; b = fir1(n,wn,y); [h,o] = freqz(b,1,256); m=20*log10(abs(h)); subplot(2,1,1); plot(o/pi,m); ylabel('Gain in dB -->'); xlabel('Normalised frequency -->'); %Band stop filter b = fir1(n,wn,'stop',y); [h,o] = freqz(b,1,256); m=20*log10(abs(h)); subplot(2,1,2); plot(o/pi,m); ylabel('Gain in dB -->'); xlabel('Normalised frequency -->');
Output
RESULT:
The program to study of FIR filter design using window method: Bandpass and
Bandstop filter is complete.