filter is a library which adds to LME functions for designing analog (continuous-time) and digital (discrete-time) linear filters.
The following statement makes available functions defined in filter:
use filter
This library provides three kinds of functions:
Transfer functions are expressed as the coefficient vectors of their numerator num and denominator den in decreasing powers of s (Laplace transform for analog filters) or z (z transform for digital filters); or as the zeros z, poles p, and gain k.
Bessel analog filter prototype.
use filter (z, p, k) = besselap(n)
besselap(n) calculates the zeros, the poles, and the gain of a Bessel analog filter of degree n with a cutoff angular frequency of 1 rad/s.
besself, buttap, cheb1ap, cheb2ap, ellipap
Bessel filter.
use filter (z, p, k) = besself(n, w0) (num, den) = besself(n, w0) (...) = besself(n, [wl, wh]) (...) = besself(n, w0, 'high') (...) = besself(n, [wl, wh], 'stop') (...) = besself(..., 's')
besself calculates a Bessel filter. The result is given as zeros, poles and gain if there are three output arguments, or as numerator and denominator coefficient vectors if there are two output arguments.
besself(n,w0), where w0 is a scalar, gives a digital lowpass filter of order n with a cutoff frequency of w0 relatively to half the sampling frequency.
besself(n,[wl,wh]), where the second input argument is a vector of two numbers, gives a digital bandpass filter of order 2*n with passband between wl and wh relatively to half the sampling frequency.
besself(n,w0,'high') gives a digital highpass filter of order n with a cutoff frequency of w0 relatively to half the sampling frequency.
besself(n,[wl,wh],'stop'), where the second input argument is a vector of two numbers, gives a digital bandstop filter of order 2*n with stopband between wl and wh relatively to half the sampling frequency.
With an additional input argument which is the string 's', besself gives an analog Bessel filter. Frequencies are given in rad/s.
besselap, butter, cheby1, cheby2, ellip
Analog-to-digital conversion with bilinear transformation.
use filter (zd, pd, kd) = bilinear(zc, pc, kc, fs) (numd, dend) = bilinear(numc, denc, fs)
bilinear(zc,pc,kc,fs) converts the analog (continuous-time)
transfer function given by its zeros zc, poles pc,
and gain kc to a digital (discrete-time) transfer function
given by its zeros, poles, and gain in the domain of the forward-shift
operator
With three input arguments, bilinear(numc,denc,fs) uses the coefficients of the numerators and denominators instead of their zeros, poles and gain.
Butterworth analog filter prototype.
use filter (z, p, k) = buttap(n)
buttap(n) calculates the zeros, the poles, and the gain of a Butterworth analog filter of degree n with a cutoff angular frequency of 1 rad/s.
butter, besselap, cheb1ap, cheb2ap, ellipap
Butterworth filter.
use filter (z, p, k) = butter(n, w0) (num, den) = butter(n, w0) (...) = butter(n, [wl, wh]) (...) = butter(n, w0, 'high') (...) = butter(n, [wl, wh], 'stop') (...) = butter(..., 's')
butter calculates a Butterworth filter. The result is given as zeros, poles and gain if there are three output arguments, or as numerator and denominator coefficient vectors if there are two output arguments.
butter(n,w0), where w0 is a scalar, gives a nth-order digital lowpass filter with a cutoff frequency of w0 relatively to half the sampling frequency.
butter(n,[wl,wh]), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandpass filter with passband between wl and wh relatively to half the sampling frequency.
butter(n,w0,'high') gives a nth-order digital highpass filter with a cutoff frequency of w0 relatively to half the sampling frequency.
butter(n,[wl,wh],'stop'), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandstop filter with stopband between wl and wh relatively to half the sampling frequency.
With an additional input argument which is the string 's', butter gives an analog Butterworth filter. Frequencies are given in rad/s.
buttap, besself, cheby1, cheby2, ellip
Chebyshev type 1 analog filter prototype.
use filter (z, p, k) = cheb1ap(n, rp)
cheb1ap(n,rp) calculates the zeros, the poles, and the gain of a Chebyshev type 1 analog filter of degree n with a cutoff angular frequency of 1 rad/s. Ripples in the passband have a peak-to-peak magnitude of rp dB, i.e. the peak-to-peak ratio is 10^(rp/20).
cheby1, cheb2ap, ellipap, besselap, buttap
Chebyshev type 2 analog filter prototype.
use filter (z, p, k) = cheb2ap(n, rs)
cheb2ap(n,rs) calculates the zeros, the poles, and the gain of a Chebyshev type 2 analog filter of degree n with a cutoff angular frequency of 1 rad/s. Ripples in the stopband have a peak-to-peak magnitude of rs dB, i.e. the peak-to-peak ratio is 10^(rs/20).
cheby1, cheb1ap, ellipap, besselap, buttap
Chebyshev type 1 filter.
use filter (z, p, k) = cheby1(n, rp, w0) (num, den) = cheby1(n, rp, w0) (...) = cheby1(n, rp, [wl, wh]) (...) = cheby1(n, rp, w0, 'high') (...) = cheby1(n, rp, [wl, wh], 'stop') (...) = cheby1(..., 's')
cheby1 calculates a Chebyshev type 1 filter. The result is given as zeros, poles and gain if there are three output arguments, or as numerator and denominator coefficient vectors if there are two output arguments.
cheby1(n,rp,w0), where w0 is a scalar, gives a nth-order digital lowpass filter with a cutoff frequency of w0 relatively to half the sampling frequency. Ripples in the passband have a peak-to-peak magnitude of rp dB, i.e. the peak-to-peak ratio is 10^(rp/20).
cheby1(n,rp,[wl,wh]), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandpass filter with passband between wl and wh relatively to half the sampling frequency.
cheby1(n,rp,w0,'high') gives a nth-order digital highpass filter with a cutoff frequency of w0 relatively to half the sampling frequency.
cheby1(n,rp,[wl,wh],'stop'), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandstop filter with stopband between wl and wh relatively to half the sampling frequency.
With an additional input argument which is the string 's', cheby1 gives an analog Chebyshev type 1 filter. Frequencies are given in rad/s.
cheb1ap, besself, butter, cheby2, ellip
Chebyshev type 2 filter.
use filter (z, p, k) = cheby2(n, rs, w0) (num, den) = cheby2(n, rs, w0) (...) = cheby2(n, rs, [wl, wh]) (...) = cheby2(n, rs, w0, 'high') (...) = cheby2(n, rs, [wl, wh], 'stop') (...) = cheby2(..., 's')
cheby2 calculates a Chebyshev type 2 filter. The result is given as zeros, poles and gain if there are three output arguments, or as numerator and denominator coefficient vectors if there are two output arguments.
cheby2(n,rs,w0), where w0 is a scalar, gives a nth-order digital lowpass filter with a cutoff frequency of w0 relatively to half the sampling frequency. Ripples in the stopband have a peak-to-peak magnitude of rs dB, i.e. the peak-to-peak ratio is 10^(rs/20).
cheby2(n,rs,[wl,wh]), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandpass filter with passband between wl and wh relatively to half the sampling frequency.
cheby2(n,rs,w0,'high') gives a nth-order digital highpass filter with a cutoff frequency of w0 relatively to half the sampling frequency.
cheby2(n,rs,[wl,wh],'stop'), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandstop filter with stopband between wl and wh relatively to half the sampling frequency.
With an additional input argument which is the string 's', cheby2 gives an analog Chebyshev type 2 filter. Frequencies are given in rad/s.
cheb2ap, besself, butter, cheby1, ellip
Elliptic filter.
use filter (z, p, k) = ellip(n, rp, rs, w0) (num, den) = ellip(n, rp, rs, w0) (...) = ellip(n, rp, rs, [wl, wh]) (...) = ellip(n, rp, rs, w0, 'high') (...) = ellip(n, rp, rs, [wl, wh], 'stop') (...) = ellip(..., 's')
ellip calculates a elliptic filter, or Cauer filter. The result is given as zeros, poles and gain if there are three output arguments, or as numerator and denominator coefficient vectors if there are two output arguments.
ellip(n,rp,rs,w0), where w0 is a scalar, gives a nth-order digital lowpass filter with a cutoff frequency of w0 relatively to half the sampling frequency. Ripples have a peak-to-peak magnitude of rp dB in the passband and of rs dB in the stopband (peak-to-peak ratios are respectively 10^(rp/20) and 10^(rs/20)).
ellip(n,rp,rs,[wl,wh]), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandpass filter with passband between wl and wh relatively to half the sampling frequency.
ellip(n,rp,rs,w0,'high') gives a nth-order digital highpass filter with a cutoff frequency of w0 relatively to half the sampling frequency.
ellip(n,rp,rs,[wl,wh],'stop'), where the second input argument is a vector of two numbers, gives a 2nth-order digital bandstop filter with stopband between wl and wh relatively to half the sampling frequency.
With an additional input argument which is the string 's', ellip gives an analog elliptic filter. Frequencies are given in rad/s.
ellipap, besself, butter, cheby1, cheby2
Elliptic analog filter prototype.
use filter (z, p, k) = ellipap(n, rp, rs)
ellipap(n,rp,rs) calculates the zeros, the poles, and the gain of an elliptic analog filter of degree n with a cutoff angular frequency of 1 rad/s. Ripples have a peak-to-peak magnitude of rp dB in the passband and of rs dB in the stopband (peak-to-peak ratios are respectively 10^(rp/20) and 10^(rs/20)).
ellip, cheb1ap, cheb1ap, besselap, buttap
Lowpass prototype to bandpass filter conversion.
use filter (z, p, k) = lp2bp(z0, p0, k0, wc, ww) (num, den) = lp2bp(num0, den0, wc, ww)
lp2bp convert a lowpass analog filter prototype (with unit angular frequency) to a bandpass analog filter with the specified center angular frequency w0 and bandwidth ww. lp2bp(z0,p0,k0,wc,ww) converts a filter given by its zeros, poles, and gain; lp2bp(num0,den0,wc,ww) converts a filter given by its numerator and denominator coefficients in decreasing powers of s.
The new filter
where
Lowpass prototype to bandstop filter conversion.
use filter (z, p, k) = lp2bs(z0, p0, k0, wc, ww) (num, den) = lp2bs(num0, den0, wc, ww)
lp2bs convert a lowpass analog filter prototype (with unit angular frequency) to a bandstop analog filter with the specified center angular frequency w0 and bandwidth ww. lp2bs(z0,p0,k0,wc,ww) converts a filter given by its zeros, poles, and gain; lp2bs(num0,den0,wc,ww) converts a filter given by its numerator and denominator coefficients in decreasing powers of s.
The new filter
where
Lowpass prototype to highpass filter conversion.
use filter (z, p, k) = lp2hp(z0, p0, k0, w0) (num, den) = lp2hp(num0, den0, w0)
lp2hp convert a lowpass analog filter prototype (with unit angular frequency) to a highpass analog filter with the specified cutoff angular frequency w0. lp2hp(z0,p0,k0,w0) converts a filter given by its zeros, poles, and gain; lp2hp(num0,den0,w0) converts a filter given by its numerator and denominator coefficients in decreasing powers of s.
The new filter
where
Lowpass prototype to lowpass filter conversion.
use filter (z, p, k) = lp2lp(z0, p0, k0, w0) (num, den) = lp2lp(num0, den0, w0)
lp2lp convert a lowpass analog filter prototype (with unit angular frequency) to a lowpass analog filter with the specified cutoff angular frequency w0. lp2lp(z0,p0,k0,w0) converts a filter given by its zeros, poles, and gain; lp2lp(num0,den0,w0) converts a filter given by its numerator and denominator coefficients in decreasing powers of s.
The new filter
where