| Signal Processing Toolbox | Search  Help Desk |
| cheby2 | Examples See Also |
Chebyshev type II filter design (stopband ripple).
Syntax
[b,a] = cheby2(n,Rs,Wn) [b,a] = cheby2(n,Rs,Wn,'ftype') [b,a] = cheby2(n,Rs,Wn,'s') [b,a] = cheby2(n,Rs,Wn,'ftype','s') [z,p,k] = cheby2(...) [A,B,C,D] = cheby2(...)
Description
cheby2 designs lowpass, highpass, bandpass, and bandstop digital and analog Chebyshev type II filters. Chebyshev type II filters are monotonic in the passband and equiripple in the stopband. Type II filters do not roll off as fast as type I filters, but are free of passband ripple.
Digital Domain
[b,a] = cheby2(n,Rs,Wn)
designs an order n lowpass digital Chebyshev type II filter with cutoff frequency Wn and stopband ripple Rs dB down from the peak passband value. It returns the filter coefficients in the length n + 1 row vectors b and a, with coefficients in descending powers of z:
-Rs dB. For cheby2, the cutoff frequency Wn is a number between 0 and 1, where 1 corresponds to half the sampling frequency (the Nyquist frequency). Larger values of stopband attenuation Rs lead to wider transition widths (shallower rolloff characteristics).
If Wn is a two-element vector, Wn = [w1 w2], cheby2 returns an order 2*n bandpass filter with passband w1 < 
< w2.
[b,a] = cheby2(n,Rs,Wn,'ftype')
designs a highpass or bandstop filter, where ftype is
high for a highpass digital filter with cutoff frequency Wn
stop for an order 2*n bandstop digital filter if Wn is a two-element vector, Wn = [w1 w2].
The stopband is w1 <
< w2.
cheby2 directly obtains other realizations of the filter. To obtain zero-pole-gain form, use three output arguments:
[z,p,k] = cheby2(n,Rs,Wn)
or
[z,p,k] = cheby2(n,Rs,Wn,'ftype')
returns the zeros and poles in length n column vectors z and p and the gain in the scalar k.
To obtain state-space form, use four output arguments:
[A,B,C,D] = cheby2(n,Rs,Wn)
or
[A,B,C,D] = cheby2(n,Rs,Wn,'ftype')
where A, B, C, and D are
Analog Domain
[b,a] = cheby2(n,Rs,Wn,'s')
designs an order n lowpass analog Chebyshev type II filter with cutoff frequency Wn. It returns the filter coefficients in the length n + 1 row vectors b and a, with coefficients in descending powers of s:
-Rs dB. For cheby2, the cutoff frequency Wn must be greater than 0.
If Wn is a two-element vector, Wn = [w1 w2], with w1 < w2, then cheby2(n,Rs,Wn,'s') returns an order 2*n bandpass analog filter with passband w1 <
< w2.
[b,a] = cheby2(n,Rs,Wn,'ftype','s')
designs a highpass or bandstop filter, where ftype is
high for a highpass analog filter with cutoff frequency Wn
stop for an order 2*n bandstop analog filter if Wn is a two-element vector, Wn = [w1 w2]
The stopband is w1 <
< w2.
[z,p,k] = cheby2(n,Rs,Wn,'s')
or
[z,p,k] = cheby2(n,Rs,Wn,'ftype','s')
returns the zeros and poles in length n or 2*n column vectors z and p and the gain in the scalar k.
To obtain state-space form, use four output arguments:
[A,B,C,D] = cheby2(n,Rs,Wn,'s')
or
[A,B,C,D] = cheby2(n,Rs,Wn,'ftype','s')
where A, B, C, and D are
Examples
For data sampled at 1000 Hz, design a ninth-order lowpass Chebyshev type II filter with stopband attenuation 20 dB down from the passband and a cutoff frequency of 300 Hz:[b,a] = cheby2(9,20,300/500);The frequency response of the filter is
freqz(b,a,512,1000)Design a fifth-order bandpass Chebyshev type II filter with passband from 100 to 200 Hz and plot the impulse response of the filter:
![]()
n = 5; r = 20; Wn = [100 200]/500; [b,a] = cheby2(n,r,Wn); [y,t] = impz(b,a,101); stem(t,y)
![]()
Limitations
For high order filters, the state-space form is the most numerically accurate, followed by the zero-pole-gain form. The transfer function coefficient form is the least accurate; numerical problems can arise for filter orders as low as 15.Algorithm
cheby2 uses a five-step algorithm:
.cheb2ap function.
...cheby2 uses bilinear to convert the analog filter
into a digital filter through a bilinear transformation with frequency
prewarping. Careful frequency adjustment guarantees that the analog
filters and the digital filters will have the same frequency response
magnitude at Wn or w1 and w2.
.See Also
besself |
Bessel analog filter design. |
butter |
Butterworth analog and digital filter design. |
cheb2ap |
Chebyshev type II analog lowpass filter prototype. |
cheb2ord |
Chebyshev type II filter order selection. |
cheby1 |
Chebyshev type I filter design (passband ripple). |
ellip |
Elliptic (Cauer) filter design. |