Quantcast

Documentation Center

  • Trial Software
  • Product Updates

cheby2

Chebyshev Type II filter design (stopband ripple)

Syntax

[z,p,k] = cheby2(n,R,Wst)
[z,p,k] = cheby2(n,R,Wst,'ftype')
[b,a] = cheby2(n,R,Wst)
[b,a] = cheby2(n,R,Wst,'ftype')
[A,B,C,D] = cheby2(n,R,Wst)
[A,B,C,D] = cheby2(n,R,Wst,'ftype')
[z,p,k] = cheby2(n,R,Wst,'s')
[z,p,k] = cheby2(n,R,Wst,'ftype','s')
[b,a] = cheby2(n,R,Wst,'s')
[b,a] = cheby2(n,R,Wst,'ftype','s')
[A,B,C,D] = cheby2(n,R,Wst,'s')
[A,B,C,D] = cheby2(n,R,Wst,'ftype','s')

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

[z,p,k] = cheby2(n,R,Wst) designs an order n lowpass digital Chebyshev Type II filter with normalized stopband edge frequency Wst and stopband ripple R dB down from the peak passband value. It returns the zeros and poles in length n column vectors z and p and the gain in the scalar k.

Normalized stopband edge frequency is the beginning of the stopband, where the magnitude response of the filter is equal to -R dB. For cheby2, the normalized stopband edge frequency Wst is a number between 0 and 1, where 1 corresponds to half the sample rate. Larger values of stopband attenuation R lead to wider transition widths (shallower rolloff characteristics).

If Wst is a two-element vector, Wst = [w1 w2], cheby2 returns an order 2*n bandpass filter with passband w1 < ω < w2.

[z,p,k] = cheby2(n,R,Wst,'ftype')designs a highpass, lowpass, or bandstop filter, where the string 'ftype' is one of the following:

  • 'high' for a highpass digital filter with normalized stopband edge frequency Wst

  • 'low' for a lowpass digital filter with normalized stopband edge frequency Wst

  • 'stop' for an order 2*n bandstop digital filter if Wst is a two-element vector, Wst = [w1 w2]. The stopband is w1 < ω < w2.

With different numbers of output arguments, cheby2 directly obtains other realizations of the filter. To obtain the transfer function form, use two output arguments as shown below.

    Note:   See Limitations below for information about numerical issues that affect forming the transfer function.

[b,a] = cheby2(n,R,Wst) designs an order n lowpass digital Chebyshev Type II filter with normalized stopband edge frequency Wst and stopband ripple R 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.

[b,a] = cheby2(n,R,Wst,'ftype') designs a highpass, lowpass, or bandstop filter, where the string 'ftype' is 'high', 'low', or 'stop', as described above.

To obtain state-space form, use four output arguments as shown below.

[A,B,C,D] = cheby2(n,R,Wst) or

[A,B,C,D] = cheby2(n,R,Wst,'ftype') where A, B, C, and D are

and u is the input, x is the state vector, and y is the output.

Analog Domain

[z,p,k] = cheby2(n,R,Wst,'s') designs an order n lowpass analog Chebyshev Type II filter with angular stopband edge frequency Wst rad/s.. It returns the zeros and poles in length n or 2*n column vectors z and p and the gain in the scalar k.

Angular stopband edge frequency is the frequency at which the magnitude response of the filter is equal to -R dB. For cheby2, the angular stopband edge frequency Wst must be greater than 0 rad/s.

If Wst is a two-element vector Wst = [w1 w2] with w1 < w2, then cheby2(n,R,Wst,'s') returns an order 2*n bandpass analog filter with passband w1 < ω< w2.

[z,p,k] = cheby2(n,R,Wst,'ftype','s') designs a highpass, lowpass, or bandstop filter, where the string 'ftype' is 'high', 'low', or 'stop', as described above.

With different numbers of output arguments, cheby2 directly obtains other realizations of the analog filter. To obtain the transfer function form, use two output arguments as shown below:

[b,a] = cheby2(n,R,Wst,'s') designs an order n lowpass analog Chebyshev Type II filter with angular stopband edge frequency Wst rad/s.. It returns the filter coefficients in the length n+1 row vectors b and a, with coefficients in descending powers of s, derived from the transfer function.

[b,a] = cheby2(n,R,Wst,'ftype','s') designs a highpass , lowpass, or bandstop filter, where the string 'ftype' is 'high', 'low', or 'stop', as described above.

To obtain state-space form, use four output arguments as shown below:

[A,B,C,D] = cheby2(n,R,Wst,'s') or

[A,B,C,D] = cheby2(n,R,Wst,'ftype','s') where A, B, C, and D are

and u is the input, x is the state vector, and y is the output.

Examples

expand all

Lowpass Chebyshev Type II Filter

For data sampled at 1000 Hz, design a 9th-order lowpass Chebyshev Type II filter with stopband attenuation 20 dB down from the passband and a stopband edge frequency of 300 Hz, which corresponds to a normalized value of 0.6. Display its frequency response.

[z,p,k] = cheby2(9,20,300/500);
sos = zp2sos(z,p,k);
fvtool(sos,'Analysis','freq')

More About

expand all

Limitations

Numerical Instability of [b,a] Form

In general, you should use the [z,p,k] syntax to design IIR filters. To analyze or implement your filter, you can then use the [z,p,k] output with zp2sos. If you design the filter using the [b,a] syntax, you may encounter numerical problems. These problems are due to round-off errors. They may occur for filter orders as low as 6. The following example illustrates this limitation.

n = 6;
r = 80;
Wn = [2.5e6 29e6]/500e6;
ftype = 'bandpass';

% Transfer function design
[b,a] = cheby2(n,r,Wn,ftype);      % This filter is unstable

% Zero-pole-gain design
[z,p,k] = cheby2(n,r,Wn,ftype);
sos = zp2sos(z,p,k);

% Plot and compare the results
hfvt = fvtool(b,a,sos,'FrequencyScale','log');
legend(hfvt,'TF Design','ZPK Design')

Algorithms

cheby2 uses a five-step algorithm:

  1. It finds the lowpass analog prototype poles, zeros, and gain using the cheb2ap function.

  2. It converts poles, zeros, and gain into state-space form.

  3. It transforms the lowpass filter into a bandpass, highpass, or bandstop filter with desired cutoff frequencies, using a state-space transformation.

  4. For digital filter design, 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 Wst or w1 and w2.

  5. It converts the state-space filter back to transfer function or zero-pole-gain form, as required.

See Also

| | | | |

Was this topic helpful?