Butterworth filter cut-off frequency

3 vues (au cours des 30 derniers jours)
raf
raf le 23 Nov 2014
Hello,
i wrote this program:
fp=500; %f trans
fs=2000; %f stopband
ap=3; %transition atten
as=22; %stopband atten
nfp = fp/(FS1/2);
nfs = fs/(FS1/2);
[n,Wn] = buttord(nfp,nfs,ap,as) ;
[b,a] = butter(n,Wn);
[bt,at] = lp2lp(b,a,Wo)
fvtool(b,a)
And the characteristic is: http://i.imgur.com/UShdzql.png
But i would like it to go trough the blue point (exactly [fp,ap] point) instead of green and red - so the "critical point" is near the transition band.
Is there a easy way to modify the code to accomplish it?
I would also need it to work, if "ap" is not necessary 3dB, but e.g. 1dB.
  2 commentaires
Star Strider
Star Strider le 23 Nov 2014
Need ‘FS1’ and ‘Wo’.
I’m guessing FS1=1E+4 but I have no idea what ‘Wo’ may be.
raf
raf le 23 Nov 2014
Modifié(e) : raf le 23 Nov 2014
soryy, ignore lp2lp() line
here is corrected code
clc;clear,close all;
FS1=10000;
fp=500; %f trans
fs=2000; %f stopband
ap=3; %transition atten
as=22; %stopband atten
nfp = fp/(FS1/2);
nfs = fs/(FS1/2);
[n,Wn] = buttord(nfp,nfs,ap,as) ;
[b,a] = butter(n,Wn);
fvtool(b,a)

Connectez-vous pour commenter.

Réponses (1)

Star Strider
Star Strider le 23 Nov 2014
It may not be possible to design a Butterworth filter with that much precision. You have to make some tradeoffs to get about 3 db attenuation at 500 Hz. Consider Chebychev and fir filters as well, if you need more definite passbands and stopbands.
Changing to these selected parameters works about as well as anything else I’ve tried:
fp = 230;
n = 3;
ap = 2;
as = 40;
You probably will need to experiment yourself to get the exact characteristics you want. This tends to be heuristic at some point.
I also refer you to the yulewalk function. It lets you design filters with specific passband and stopband characteristics.

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by