IIRFilters::ChebyshevIIAnalog Function

void ChebyshevIIAnalog(int Order, double StopRipple, TVec *z, TVec *p, double &k);

Design an analog Chebyshev type II (inverse Chebyshev) lowpass prototype filter of order Order with StopRipple dB of equiripple attenuation in the stopband, cutoff fixed at 1 rad/s. Returns zero-pole-gain with finite imaginary-axis zeros: |H(jomega)|^2=1/(1+[varepsilon^2 T_n^2(1/omega)]^(-1)), varepsilon=1/(sqrt(10^(R_s/10)-1)), z_k=j/(cos((2k-1)pi)/2n). The magnitude is maximally flat in the passband and equiripple in the stopband; at the stopband edge omega=1 it equals 10^(-R_s/20) where R_s=StopRipple. Domain: 1 <= Order <= MaxIirOrder, StopRipple>0 dB. Poles satisfy Re(p_k)<0 (stable). z and p must share precision or an exception is raised.

#NameTypeDescription
1Orderint
2StopRippledouble
3zTVec *
4pTVec *
5kdouble &
Remarks:

Design analog Chebyshev type II lowpass prototype filter of order Order. Place the resulting
transfer function in zero-pole form in Z (zeros), P (poles) and K (gain). Ripple defines the StopRipple (dB) of the stopband.The cutoff frequency of the prototype filter is preset to 1 rad/sec, the unit circle.

Chebyshevs type II filters have poles and zeros and are equiripple in the stopband. The design formulas are found in [1] p. 232:

Wr
Zeros: z[k] = j* --------------------- cos((2*k-1)/(2*n)*Pi)
Poles: p[k] = s[k] + j*W[k] Wr*a[k]
s[k] = ----------------- a[k]^2 + b[k]^2
-Wr*b[k]
W[k] = ----------------- a[k]^2 + b[k]^2
a[k] = -sinh(Phi)sin((2*k-1)*Pi/(2*n)) b[k] = cosh(Phi)*cos((2*k-1)*Pi/(2*n)) sinh(phi) = 0.5(v - 1/v) cosh(phi) = 0.5*(v + 1/v) v = (A + (A^2 - 1)^0.5)^(1/n), A = 1/sr^2 n - order of the filter k = 1,...,n
Wr - stopband edge
sr - stopband ripple

References:

[1] "Theory and application of digital signal processing, Lawrence R. Rabiner and Bernard Gold. Prentice-Hall, 1975".

Examples
#include "MtxExpr.h"
#include "Units.Math387.h"
#include "Units.IIrFilters.h"
#include "Units.LinearSystems.h"
#include "Units.SignalUtils.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;
using namespace Dew::Signal;
using namespace Dew::Signal::Units::IIRFilters;
using namespace Dew::Signal::Units::LinearSystems;
using namespace Dew::Signal::Units::SignalUtils;

void Example()
{
    Vector z(0);
    Vector p(0);
    Vector num(0);
    Vector den(0);
    Vector Response(0);
    Vector FreqFr(0);
    double k, Wc;
    int Order = 5; //design a fifth order filter.

    ChebyshevIIAnalog(Order, 20, z, p, k);  //design analog protype
    Wc = Sqrt(3*2); //cutoff frequency
    double BW = 3 - 2;
    LowpassToBandpass(z, p, k, Wc, BW);
    ZeroPoleToTransferFun(num, den, z, p, k);
    FreqFr.Length = 1000;
    LogRamp(FreqFr, -1, 1);

    FrequencyResponseS(num, den, FreqFr, Response, 0);
}
See Also: IIRFilters::ChebyshevIFilter, LowpassToHighpass, Bilinear
Declared in Dew::Signal::Units::IIRFilters · Dew.Signal/Units.IIrFilters.h · Cross-compiler