IIRFilters::ButterAnalog Function

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

Design an analog Butterworth lowpass prototype filter of order Order, cutoff fixed at 1 rad/s. Returns zero-pole-gain in z (zeros), p (poles), k (gain): H(s)=k/(prod_(i=1)^n(s-p_i)), p_k=exp(j(pi/2+(pi(2k-1))/2n)), k=1... n. All n poles lie on the left half of the unit circle (so the prototype is stable, Re(p_k)<0) and all zeros are at infinity (z is returned empty), giving a maximally-flat magnitude that is 3 dB down at omega=1. Domain: Order is a positive integer, 1 <= Order <= MaxIirOrder (=50). z and p must share the same precision; a precision mismatch raises an exception. No NaN is produced for valid input.

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

Design analog butterworth lowpass prototype filter of order Order. Place the resulting transfer function in zero-pole form in Z (zeros), P (poles) and K (gain). The cutoff frequency of the prototype filter is preset to 1 rad/sec.

The filter has all zeros in infinity. The transfer function is defined as ([1], p. 277):

k0 H(s) = ------------------------- (s - s[1])...(s - s[n]) The poles of the filter are located at s[k] := Expj(Pi*(0.5+(2*k-1)/(2*n))); n = order of filter k = 1,...,n k0 = gain

The magnitude response is down 3dB at the cutoff frequency.

References:

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

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

using namespace Dew;
using namespace Dew::Math;
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.

    ButterAnalog(Order, z, p, k);  //design analog protype
    Wc = 3; //cutoff frequency
    LowpassToLowpass(z, p, k, Wc);
    ZeroPoleToTransferFun(num, den, z, p, k);
    FreqFr.Length = 1000;
    LogRamp(FreqFr, -1, 1);

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