Generates filter coefficients for a digital or analog Chebyshev Type II filter. |
||
Syntax |
Num, Den = Cheby2(Order,Fc,StopMag) Num, Den = Cheby2(Order,Fc,StopMag,Type) Num, Den = Cheby2(Order,Fc,StopMag,Band,Type) Num, Den = Cheby2(Order,Fc1,Fc2,StopMag) |
|
Arguments |
Name |
Description |
Order |
A positive integer specifying the order of the filter. For band pass and band stop filter, the order is twice this value. |
|
Fc |
The corner frequency in Hz of a low pass or high pass filter, or a vector of two corner frequencies for a band pass or band stop filter. For a digital filter, Fc is normalized by the Nyquist frequency and has values in the interval (0,1). For an analog filter, Fc has positive value(s). |
|
Band (optional) |
The filter band specifier. When Fc is a value, Band can be either ‘low’ (default) or ‘high.’ When Fc is a vector, Band is omitted for a band pass filter and ‘stop’ for a band stop filter. |
|
Type (optional) |
The digital/analog flag. For analog, set to ‘s.’ For digital, set to ‘z’ (default). |
|
Fc1, Fc2 |
For the Templex™ style convention, Fc1 and Fc2 are the normalized corner frequencies in Hz of a digital filter. For a low pass filter, Fc1 = 0. For a high pass filter, Fc2 = 0 or 1. For a band pass filter, Fc1 < Fc2. For a band stop filter, Fc1 > Fc2. |
|
|
StopMag |
Magnitude attenuation in decibels (dB) at the nonzero corner frequencies specified by Fc. This is also called the stopband ripple. Must be negative. |
Outputs |
Name |
Description |
Num |
Vector of numerator coefficients in descending power of s or z. Its length is one more than the filter order. |
|
Den |
Vector of denominator coefficients in descending power of s or z. Its length is one more than the filter order. |
|
Example 1 |
A low-pass second order Chebyshev II filter with a corner frequency at 250 Hz and a corresponding magnitude of -20 dB, where the data sampling frequency is 1000 Hz. |
|
Syntax |
||
b, a = Cheby2(2,0,250/500,-20) |
||
Result |
||
b = 0.16667 0.11111 0.16667 a = 1.0000 -0.88889 0.33333 |
||
Example 2 |
A band-pass second order Chebyshev II filter with low corner and high corner frequencies of 150 Hz and 300 Hz, respectively, with corresponding magnitude responses of -20 dB, where the data sampling frequency is 1000 Hz. |
|
Syntax |
||
b, a = Cheby2(2,150/500,300/500,-20) |
||
Result |
||
b = 0.1119 -0.051728 0.079906 -0.051728 0.1119 a = 1.0000 -0.59635 1.4875 -0.43821 0.54964 |
||
Comments |
For digital filters, the Nyquist frequency is half the sampling frequency. All frequency arguments are to be normalized with this value. |
|
See Also: |