## cheby2(n, Rs, Wn)

import signals.filters.iir-1

Design Chebyshev type 2 IIR filter with Matlab-like syntax.

import signals.filters.iir-1;
Chebyshev 2 digital filter design
 filt=cheby2(4,-60dB,0.3[0.3,0.7],"lowhighbandpassstop") 
 n The order of filter. Rs Passband ripple. Wn Yhe relative corner frequency. return value Transfer function object.

The function can be used in several ways:

• cheby2(n,Rs,Wn) - Design an n pole lowpass or bandpass Chebysev type 2 filter with Rs stopband attenuation, corner frequency Wn (scalar or 2 element vector).
• cheby2(n,Rs,Wn,type) - Design an n pole lowpass, highpass, bandpass, or bandstop Chebysev type 2 filter with Rs stopband attenuation, corner frequencies specified by Wn (scalar or 2 element vector).
• cheby2(...,'s') - If 's' is added to the end of the function, an analog filter will be designed.
The parameter Wn is the relative corner frequency of the filter for digital filters. For analog filters, it is specified in radians per second. The size of the Wn depends on the type of the filter:
• lowpass, highpass - A scalar value representing the corner frequency of the filter.
• bandpass, bandstop - A 2-element vector representing the corner frequencies: [Wn1 Wn2]. Wn1 < Wn2.
The relative frequency in case of digital filters is defined as $2\frac{f}{f_s}$, where f is the frequency of interest. Thus 0 means 0Hz, 1 means the Nyquist rate (fs/2).

Parameter type is a string value describing the filter type:

• "low": lowpass (you can omit type)
• "high": highpass
• "bandpass": bandpass (you can omit type)
• "stop": bandstop
 filt=cheby2(4,-60dB,0.3[0.3,0.7],"lowhighbandpassstop") 
 filt=cheby2(4,-60dB,0.3[0.3,0.7],"lowhighbandpassstop","s") 
 filt.plotAmplitudePhaseZerosPolseImpulseResponse()