Butterworth filter order and cutoff frequency
[n,Wn] = buttord(Wp,Ws,Rp,Rs)
[n,Wn] = buttord(Wp,Ws,Rp,Rs,'s
')
buttord
calculates the minimum order of a digital or analog Butterworth
filter required to meet a set of filter design specifications.
[n,Wn] = buttord(Wp,Ws,Rp,Rs)
returns the lowest order, n
, of the
digital Butterworth filter with no more than Rp
dB of passband ripple and at least Rs
dB of attenuation in the stopband. The scalar (or vector)
of corresponding cutoff frequencies, Wn
, is also
returned. Use the output arguments n
and Wn
in butter
.
Choose the input arguments to specify the stopband and passband according to the following table.
Description of Stopband and Passband Filter Parameters
Use the following guide to specify filters of different types.
Filter Type Stopband and Passband Specifications
Filter Type  Stopband and Passband Conditions  Stopband  Passband 



 
Highpass 



Bandpass  The interval specified by 


Bandstop  The interval specified by 


If your filter specifications call for a bandpass or bandstop filter with unequal ripple in each of the passbands or stopbands, design separate lowpass and highpass filters according to the specifications in this table, and cascade the two filters together.
[n,Wn] = buttord(Wp,Ws,Rp,Rs,'
finds
the minimum order s
')n
and cutoff frequencies Wn
for
an analog Butterworth filter.
You specify the frequencies Wp
and Ws
similar
those described in the Description of Stopband and Passband Filter
Parameters table
above, only in this case you specify the frequency in radians per
second, and the passband or the stopband can be infinite.
Use buttord
for lowpass, highpass, bandpass,
and bandstop filters as described in the Filter Type Stopband and Passband Specifications table above.
[1] Rabiner, Lawrence R., and Bernard Gold. Theory and Application of Digital Signal Processing. Englewood Cliffs, NJ: PrenticeHall, 1975.