# cheby2

Chebyshev Type II filter design

## Syntax

## Description

`[`

designs an `b,a`

] = cheby2(`n`

,`Rs`

,`Ws`

)`n`

th-order lowpass digital Chebyshev Type II
filter with normalized stopband edge frequency `Ws`

and
`Rs`

decibels of stopband attenuation down from the peak
passband value. The `cheby2`

function returns the
numerator and denominator coefficients of the filter transfer function.

`[`

designs a lowpass, highpass, bandpass, or bandstop digital Chebyshev
Type II filter, depending on the value of `b,a`

] = cheby2(`n`

,`Rs`

,`Ws`

,`fType`

)`fType`

and
the number of elements of `Ws`

. The resulting bandpass and
bandstop designs are of order 2`n`

.

**Note**

You might encounter numerical instabilities when designing IIR filters with transfer functions for orders as low as 4. See Transfer Functions and CTF for more information about numerical issues that affect forming the transfer function.

`[`

designs a digital Chebyshev Type II filter and returns its zeros, poles,
and gain. This syntax can include any of the input arguments in previous
syntaxes.`z,p,k`

] = cheby2(___)

`[___] = cheby2(___,"s")`

designs
an analog Chebyshev Type II filter using any of the input or output
arguments in previous syntaxes.

`[`

designs a lowpass digital Chebyshev Type II filter using second-order Cascaded Transfer Functions
(CTF). The function returns matrices that list the denominator and numerator
polynomial coefficients of the filter transfer function, represented as a
cascade of filter sections. This approach generates IIR filters with improved
numerical stability compared to single-section transfer functions.`B,A`

] = cheby2(`n`

,`Rs`

,`Ws`

,"ctf")* (since R2024b)*

`[___] = cheby2(`

designs a lowpass, highpass, bandpass, or bandstop digital Chebyshev
Type II filter, and returns the filter representation using the CTF format.
The resulting design sections are of order 2 (lowpass and highpass filters) or 4
(bandpass and bandstop filters).`n`

,`Rs`

,`Ws`

,`fType`

,"ctf")* (since R2024b)*

`[___,`

also returns the overall gain of the system. You must specify
`gS`

] = cheby2(___)`"ctf"`

to return `gS`

.* (since R2024b)*

## Examples

## Input Arguments

## Output Arguments

## More About

## Algorithms

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.

`cheby2`

uses a five-step algorithm:

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

`cheb2ap`

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

If required, it uses a state-space transformation to convert the lowpass filter into a bandpass, highpass, or bandstop filter with the desired frequency constraints.

For digital filter design, it uses

`bilinear`

to convert the analog filter into a digital filter through a bilinear transformation with frequency prewarping. Careful frequency adjustment the analog filters and the digital filters to have the same frequency response magnitude at`Ws`

or`w1`

and`w2`

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

## References

[1] Lyons, Richard
G. *Understanding Digital Signal Processing*. Upper Saddle River, NJ:
Prentice Hall, 2004.

## Extended Capabilities

## Version History

**Introduced before R2006a**