Professional Documents
Culture Documents
Matlab - What Is The Command For Butterworth Bandpass Filter - Stack Overflow
Matlab - What Is The Command For Butterworth Bandpass Filter - Stack Overflow
matlabwhatisthecommandforbutterworthbandpassfilterStackOverflow
signup
login
tour
help
stackoverflowcareers
Signup
StackOverflowisacommunityof4.7millionprogrammers,justlikeyou,helpingeachother.Jointhem,itonlytakesaminute:
whatisthecommandforbutterworthbandpassfilter
Ihavesignaldatatofilterusingbandpassfilterwhichthefrequenciesare1045s,45150sand150600s.howtocreatebandpassfilter
commandinmatlabtofilterthatfrequencies?
matlab
editedJun27'13at10:13
askedJun27'13at10:00
VishnuRenku
baizura
1,480
14
15
36
1Answer
Theoutputsignal y isobtainedbyfilteringtheinputsignal
usingthe butter command.
usingthecoefficientsgenerated
Ifyouwanttohavetheoutputfromall3bandsatonce,youcansumtheoutputsfrom3separate
filteroperations,oneforeachband.However,youmayliketousethe filtfilt commandover
filter whendoingthisifyouwanttopreservethephaserelationshipbetweenthebands.
Ifyoudonothavethesignalprocessingtoolbox,youcancreate2ndorderbandpassbutterworth
coefficientsusingthecodebelow,where dt=1/fs and fl and fu arelowandhighcutoff
frequencies.
function[b,a]=butterTwoBp(dt,fl,fu)
q=pi*dt*(fufl);
r=pi*dt*(fu+fl);
N=(tan(q)^2)+sqrt(2)*tan(q)+1;
M=(tan(q)^2)/N;%MafterNbecauseitdependsonN
O=cos(r)*(2*sqrt(2)*tan(q)+4)/((cos(q))*N);
P=(2*(tan(q)^2)+(((2*cos(r))/(cos(q)))^2)+2)/N;
Q=cos(r)*(2*sqrt(2)*tan(q)4)/(cos(q)*N);
R=((tan(q)^2)sqrt(2)*tan(q)+1)/N;
b=[M02*M0M];
a=[1OPQR];
editedJun27'13at10:49
answeredJun27'13at10:31
learnvst
6,421
http://stackoverflow.com/questions/17340198/whatisthecommandforbutterworthbandpassfilter
30
65
1/2
11/13/2015
matlabwhatisthecommandforbutterworthbandpassfilterStackOverflow
http://stackoverflow.com/questions/17340198/whatisthecommandforbutterworthbandpassfilter
2/2