create analog low-pass filter
positive integer: filter order
a string: that indicated the filter design method:
"butt" is for Butterworth filter.
"cheb1" is for Chebyshev type I filter.
"cheb2" is for Chebyshev type II filter (also called inverse Chebyshev filter).
"ellip" is for elliptic filter.
a 2-vector of ripples values for "cheb1", "cheb2" and "ellip" filters. It's elements value must respect
For "cheb1" filters only
rp(1)is used. The passband ripple is between
For "cheb2" filters only
rp(2)is used. The stopband ripple is between
For "ellip" filters
rp(2)are both used. The passband ripple is between
1while the stopband ripple is between
cut-off frequency of low-pass filter in rad/s
the rational polynomial transfer function (see syslin). Is is
hs = gain*syslin("c", real(poly(zers, "s")), real(poly(pols, "s")))
a row vector: the poles of transfer function
a row vector: zeros of transfer function
a scalar: the gain of transfer function
This Creates analog low-pass filter with cut-off pulsation at omega. It is a driver over the zpbutt, zpch1, zpch2 and zpell functions.
The Butterworth filter has no ripples in the passband and slowly rolls off towards zero in the stopband. Butterworth filters have a monotonically changing magnitude function with omega, unlike other filter types that have non-monotonic ripple in the passband and/or the stopband. Butterworth filters have a more linear phase response in the pass-band than the others.
Chebyshev filters have a steeper roll-off and more passband ripple (type I) or stopband ripple (type II) than Butterworth filters. Chebyshev filters have the property that they minimize the error between the idealized and the actual filter characteristic over the range of the filter, but with ripples in the passband.
Elliptic filter have equalized ripple behavior in both the passband and the stopband. The amount of ripple in each band is independently adjustable, and no other filter of equal order can have a faster transition in gain between the passband and the stopband, for the given values of ripple.
// Evaluate magnitude response of the filter fcut = 5; //hz n = 7; // Filter order hc1 = analpf(n, 'cheb1', [0.1 0], fcut*2*%pi); hc2 = analpf(n, 'cheb2', [0 0.1], fcut*2*%pi); he = analpf(n, 'ellip', [0.1 0.1], fcut*2*%pi); hb = analpf(n, 'butt', [0 0], fcut*2*%pi); hc1.dt = 'c'; hc2.dt = 'c'; he.dt = 'c'; hb.dt = 'c'; clf(); [fr, hf] = repfreq(hc1, 0, 15); plot(fr, abs(hf), 'b') [fr, hf] = repfreq(hc2, 0, 15); plot(fr,abs(hf),'g') [fr, hf] = repfreq(he, 0, 15); plot(fr,abs(hf),'r') [fr, hf] = repfreq(hb, 0, 15); plot(fr, abs(hf), 'c') legend(["Chebyshev I", "Chebyshev II", "Elliptic", "Butterworth"]); xgrid() xlabel("Frequency (Hz)") ylabel("Gain") title("Analog filters of order 7")
|Report an issue|
|<< How to design an elliptic filter||Filters||buttmag >>|