0% found this document useful (0 votes)
30 views2 pages

Udhay 8

The document designs and plots different types of FIR filters (low pass, high pass, band pass, and band stop) based on user-specified passband ripple, stopband ripple, passband cutoff frequency, stopband cutoff frequency, and sampling frequency. It uses the Hamming window to design the filters and plots the frequency response of each filter, showing the gain in dB across the normalized frequency range.

Uploaded by

Muthu Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Udhay 8

The document designs and plots different types of FIR filters (low pass, high pass, band pass, and band stop) based on user-specified passband ripple, stopband ripple, passband cutoff frequency, stopband cutoff frequency, and sampling frequency. It uses the Hamming window to design the filters and plots the frequency response of each filter, showing the gain in dB across the normalized frequency range.

Uploaded by

Muthu Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Program: clc; clear all; rp=input('enter the Pass band ripple:'); rs=input('enter the stop band ripple:'); fp=input('enter

the Pass band cut off frequency:'); fs=input('enter the Stop band cut off frequency :'); f=input('sampling frequency'); ws=(2*fs/f); wp=(2*fp/f); num=20*log10(sqrt(rp*rs))-13; Den=(14.6*(fs-fp))/f; n=ceil(num/Den); n1=n+1; if(rem(n,2)~=0) n1=n; n=n-1; end; y=hamming(n1); %y=hanning(n1); %y=blackman(n1); %y=bartlett(n1); %y=boxcar(n1); b=fir1(n,wp,y); [h,a]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,1); plot(m); title('low pass filter'); ylabel('gain in db'); xlabel('normalised frequency'); b=fir1(n,wp,'high',y); [h,a]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,2); plot(m); title('high pass filter'); ylabel('gain in db'); xlabel('normalised frequency'); wn=[wp,ws]; b=fir1(n,wn,y); [h,a]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,3); plot(m); title('band pass filter'); ylabel('gain in db'); xlabel('normalised frequency'); b=fir1(n,wn,'stop',y); [h,a]=freqz(b,1,256); m=20*log10(abs(h)); subplot(2,2,4); plot(m); title('band stop filter'); ylabel('gain in db'); xlabel('normalised frequency');

output(hamming window): enter the Pass band enter the stop band enter the Pass band enter the Stop band sampling frequency3 ripple:10 ripple:20 cut off frequency:0.4 cut off frequency :0.6

low pass filter 0 -20 -40 -60 -80 -100 gain in db gain in db 10 0 -10 -20 -30

high pass filter

100 200 normalised frequency band pass filter

300

100 200 normalised frequency band stop filter

300

20 0 gain in db -20 -40 -60 -80 gain in db 0 100 200 normalised frequency 300

1 0 -1 -2 -3 -4

100 200 normalised frequency

300

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy