SciPy 0.6.0 API Documentation Generated by Endo, 2007-10-17
Filter design.
EPSILON = 2e-16
abs = absolute
band_dict = { Const('band') : Const('bandpass'), Const('bandpass') : Const('bandpass'), Const('pass') : Const('bandpass'), Const('bp') : Const('bandpass'), Const('bs') : Const('bandstop'), Const('bandstop') : Const('bandstop'), Const('bands') : Const('bandstop'), Const('stop') : Const('bandstop'), Const('l') : Const('lowpass'), Const('low') : Const('lowpass'), Const('lowpass') : Const('lowpass'), Const('high') : Const('highpass'), Const('highpass') : Const('highpass'), Const('h') : Const('highpass') }
filter_dict = { Const('butter') : List([Name('buttap'), Name('buttord')]), Const('butterworth') : List([Name('buttap'), Name('buttord')]), Const('cauer') : List([Name('ellipap'), Name('ellipord')]), Const('elliptic') : List([Name('ellipap'), Name('ellipord')]), Const('ellip') : List([Name('ellipap'), Name('ellipord')]), Const('bessel') : List([Name('besselap')]), Const('cheby1') : List([Name('cheb1ap'), Name('cheb1ord')]), Const('chebyshev1') : List([Name('cheb1ap'), Name('cheb1ord')]), Const('chebyshevi') : List([Name('cheb1ap'), Name('cheb1ord')]), Const('cheby2') : List([Name('cheb2ap'), Name('cheb2ord')]), Const('chebyshev2') : List([Name('cheb2ap'), Name('cheb2ord')]), Const('chebyshevii') : List([Name('cheb2ap'), Name('cheb2ord')]) }
Band Stop Objective Function for order minimization
Description:
Returns the non-integer order for an analog band stop filter.
Inputs:
wp -- passb edge ind -- index specifying which passb edge to vary (0 or 1). passb -- two element vector of fixed passband edges. stopb -- two element vector of fixed stopband edges. gstop -- amount in dB of attenuation in stopband. gpass -- amount in dB of ripple in the passband. type -- 'butter', 'cheby', or 'ellip':
Outputs: (n,)
n -- filter order (possibly non-integer)
Bessel digital and analog filter design.
Description:
Design an Nth order lowpass digital or analog Bessel filter and return the filter coefficients in (B,A) or (Z,P,K) form.
Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Bessel filter.
Return a digital filter from an analog filter using the bilinear transform.
The bilinear transform substitutes (z-1) / (z+1) for s
Return (z,p,k) zero, pole, gain for analog prototype of an Nth order Butterworth filter.
Butterworth digital and analog filter design.
Description:
Design an Nth order lowpass digital or analog Butterworth filter and return the filter coefficients in (B,A) or (Z,P,K) form.
See also buttord.
Butterworth filter order selection.
Description:
Return the order of the lowest order digital Butterworth filter that
loses no more than gpass dB in the passband and has at least gstop dB
attenuation in the stopband.
Inputs:
wp, ws -- Passband and stopband edge frequencies, normalized from 0
to 1 (1 corresponds to pi radians / sample). For example:
Lowpass: wp = 0.2, ws = 0.3
Highpass: wp = 0.3, ws = 0.2
Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6]
Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5]
gpass -- The maximum loss in the passband (dB).
gstop -- The minimum attenuation in the stopband (dB).
analog -- Non-zero to design an analog filter (in this case wp and
ws are in radians / second).
Outputs: (ord, Wn)
ord -- The lowest order for a Butterworth filter which meets specs.
Wn -- The Butterworth natural frequency (i.e. the "3dB frequency").
Should be used with scipy.signal.butter to give filter results.
Return (z,p,k) zero, pole, gain for Nth order Chebyshev type I lowpass analog filter prototype with rp decibels of ripple in the passband.
Chebyshev type I filter order selection.
Description:
Return the order of the lowest order digital Chebyshev Type I filter
that loses no more than gpass dB in the passband and has at least gstop dB
attenuation in the stopband.
Inputs:
wp, ws -- Passband and stopband edge frequencies, normalized from 0
to 1 (1 corresponds to pi radians / sample). For example:
Lowpass: wp = 0.2, ws = 0.3
Highpass: wp = 0.3, ws = 0.2
Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6]
Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5]
gpass -- The maximum loss in the passband (dB).
gstop -- The minimum attenuation in the stopband (dB).
analog -- Non-zero to design an analog filter (in this case wp and
ws are in radians / second).
Outputs: (ord, Wn)
ord -- The lowest order for a Chebyshev type I filter that meets specs.
Wn -- The Chebyshev natural frequency (the "3dB frequency") for
use with scipy.signal.cheby1 to give filter results.
Return (z,p,k) zero, pole, gain for Nth order Chebyshev type II lowpass analog filter prototype with rs decibels of ripple in the stopband.
Chebyshev type II filter order selection.
Description:
Return the order of the lowest order digital Chebyshev Type II filter
that loses no more than gpass dB in the passband and has at least gstop dB
attenuation in the stopband.
Inputs:
wp, ws -- Passband and stopband edge frequencies, normalized from 0
to 1 (1 corresponds to pi radians / sample). For example:
Lowpass: wp = 0.2, ws = 0.3
Highpass: wp = 0.3, ws = 0.2
Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6]
Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5]
gpass -- The maximum loss in the passband (dB).
gstop -- The minimum attenuation in the stopband (dB).
analog -- Non-zero to design an analog filter (in this case wp and
ws are in radians / second).
Outputs: (ord, Wn)
ord -- The lowest order for a Chebyshev type II filter that meets specs.
Wn -- The Chebyshev natural frequency for
use with scipy.signal.cheby2 to give the filter.
Chebyshev type I digital and analog filter design.
Description:
Design an Nth order lowpass digital or analog Chebyshev type I filter and return the filter coefficients in (B,A) or (Z,P,K) form.
See also cheb1ord.
Chebyshev type I digital and analog filter design.
Description:
Design an Nth order lowpass digital or analog Chebyshev type I filter and return the filter coefficients in (B,A) or (Z,P,K) form.
See also cheb2ord.
Elliptic (Cauer) digital and analog filter design.
Description:
Design an Nth order lowpass digital or analog elliptic filter and return the filter coefficients in (B,A) or (Z,P,K) form.
See also ellipord.
Return (z,p,k) zeros, poles, and gain of an Nth order normalized prototype elliptic analog lowpass filter with rp decibels of ripple in the passband and a stopband rs decibels down.
See Chapter 12 and Chapter 5 of "Filter Design for Signal Processing", by Lutova, Tosic, and Evans. This is
Elliptic (Cauer) filter order selection.
Description:
Return the order of the lowest order digital elliptic filter
that loses no more than gpass dB in the passband and has at least
gstop dB attenuation in the stopband.
Inputs:
wp, ws -- Passband and stopband edge frequencies, normalized from 0
to 1 (1 corresponds to pi radians / sample). For example:
Lowpass: wp = 0.2, ws = 0.3
Highpass: wp = 0.3, ws = 0.2
Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6]
Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5]
gpass -- The maximum loss in the passband (dB).
gstop -- The minimum attenuation in the stopband (dB).
analog -- Non-zero to design an analog filter (in this case wp and
ws are in radians / second).
Outputs: (ord, Wn)
ord -- The lowest order for an Elliptic (Cauer) filter that meets specs.
Wn -- The natural frequency for use with scipy.signal.ellip
to give the filter.
FIR Filter Design using windowed ideal filter method.
Inputs:
N -- order of filter (number of taps)
cutoff -- cutoff frequency of filter (normalized so that 1 corresponds to
Nyquist or pi radians / sample)
width -- if width is not None, then assume it is the approximate width of
the transition region (normalized so that 1 corresonds to pi)
for use in kaiser FIR filter design.
window -- desired window to use.
Outputs:
h -- coefficients of length N fir filter.
Compute frequency response of analog filter.
Description:
Given the numerator (b) and denominator (a) of a filter compute its
frequency response.
b[0]*(jw)**(nb-1) + b[1]*(jw)**(nb-2) + ... + b[nb-1]
H(w) = --------------------------------------------------------
a[0]*(jw)**(na-1) + a[1]*(jw)**(na-2) + ... + a[na-1]
Inputs:
b, a --- the numerator and denominator of a linear filter.
worN --- If None, then compute at 200 frequencies around the interesting
parts of the response curve (determined by pole-zero locations).
If a single integer, the compute at that many frequencies.
Otherwise, compute the response at frequencies given in worN.
Outputs: (w,h)
w -- The frequencies at which h was computed.
h -- The frequency response.
Compute frequency response of a digital filter.
Description:
Given the numerator (b) and denominator (a) of a digital filter compute
its frequency response.
jw -jw -jmw
jw B(e) b[0] + b[1]e + .... + b[m]e
H(e) = ---- = ------------------------------------
jw -jw -jnw
A(e) a[0] + a[2]e + .... + a[n]e
Inputs:
b, a --- the numerator and denominator of a linear filter.
worN --- If None, then compute at 512 frequencies around the unit circle.
If a single integer, the compute at that many frequencies.
Otherwise, compute the response at frequencies given in worN
whole -- Normally, frequencies are computed from 0 to pi (upper-half of
unit-circle. If whole is non-zero compute frequencies from 0
to 2*pi.
Outputs: (w,h)
w -- The frequencies at which h was computed.
h -- The frequency response.
Complete IIR digital and analog filter design.
Description:
Given passband and stopband frequencies and gains construct an analog or
digital IIR filter of minimum order for a given basic type. Return the
output in numerator, denominator ('ba') or pole-zero ('zpk') form.
Inputs:
wp, ws -- Passband and stopband edge frequencies, normalized from 0
to 1 (1 corresponds to pi radians / sample). For example:
Lowpass: wp = 0.2, ws = 0.3
Highpass: wp = 0.3, ws = 0.2
Bandpass: wp = [0.2, 0.5], ws = [0.1, 0.6]
Bandstop: wp = [0.1, 0.6], ws = [0.2, 0.5]
gpass -- The maximum loss in the passband (dB).
gstop -- The minimum attenuation in the stopband (dB).
analog -- Non-zero to design an analog filter (in this case wp and
ws are in radians / second).
ftype -- The type of iir filter to design:
elliptic : 'ellip'
Butterworth : 'butter',
Chebyshev I : 'cheby1',
Chebyshev II: 'cheby2',
Bessel : 'bessel'
output -- Type of output: numerator/denominator ('ba') or pole-zero ('zpk')
Outputs: (b,a) or (z,p,k)
b,a -- Numerator and denominator of the iir filter.
z,p,k -- Zeros, poles, and gain of the iir filter.
IIR digital and analog filter design given order and critical points.
Description:
Design an Nth order lowpass digital or analog filter and return the filter
coefficients in (B,A) (numerator, denominator) or (Z,P,K) form.
Inputs:
N -- the order of the filter.
Wn -- a scalar or length-2 sequence giving the critical frequencies.
rp, rs -- For chebyshev and elliptic filters provides the maximum ripple
in the passband and the minimum attenuation in the stop band.
btype -- the type of filter (lowpass, highpass, bandpass, or bandstop).
analog -- non-zero to return an analog filter, otherwise
a digital filter is returned.
ftype -- the type of IIR filter (Butterworth, Cauer (Elliptic),
Bessel, Chebyshev1, Chebyshev2)
output -- 'ba' for (b,a) output, 'zpk' for (z,p,k) output.
SEE ALSO butterord, cheb1ord, cheb2ord, ellipord
Design a Kaiser window to limit ripple and width of transition region.
Inputs:
- ripple -- positive number specifying maximum ripple in passband (dB)
- and minimum ripple in stopband
- width -- width of transition region (normalized so that 1 corresponds
- to pi radians / sample)
Outputs:
N, beta -- the order and beta parameter for the kaiser window.
signal.kaiser(N,beta,sym=0) returns the window as does signal.get_window(beta,N) signal.get_window(('kaiser',beta),N)
Uses the empirical equations discovered by Kaiser.
Oppenheim, Schafer, "Discrete-Time Signal Processing,", p.475-476.
Return a band-pass filter with center frequency wo and bandwidth bw from a low-pass filter prototype with unity cutoff frequency.
Return a band-stop filter with center frequency wo and bandwidth bw from a low-pass filter prototype with unity cutoff frequency.
Return a high-pass filter with cuttoff frequency wo from a low-pass filter prototype with unity cutoff frequency.
Return a low-pass filter with cuttoff frequency wo from a low-pass filter prototype with unity cutoff frequency.
Normalize polynomial representation of a transfer function.
Return zero, pole, gain (z,p,k) representation from a numerator, denominator representation of a linear filter.
Return polynomial transfer function representation from zeros and poles
Inputs:
z, p --- sequences representing the zeros and poles. k --- system gain.
Outputs: (b,a)
b, a --- numerator and denominator polynomials.
| Local name | Refers to |
|---|---|
| absolute | numpy.absolute |
| allclose | numpy.allclose |
| arccosh | numpy.arccosh |
| arcsinh | numpy.arcsinh |
| arctan | numpy.arctan |
| asarray | numpy.asarray |
| atleast_1d | numpy.atleast_1d |
| ceil | numpy.ceil |
| comb | scipy.misc.comb |
| conjugate | numpy.conjugate |
| cos | numpy.cos |
| cosh | numpy.cosh |
| exp | numpy.exp |
| log10 | numpy.log10 |
| logspace | numpy.logspace |
| mintypecode | numpy.mintypecode |
| numpy | numpy |
| optimize | scipy.optimize |
| pi | numpy.pi |
| poly | numpy.poly |
| polyval | numpy.polyval |
| real | numpy.real |
| resize | numpy.resize |
| roots | numpy.roots |
| r_ | numpy.r_ |
| sinh | numpy.sinh |
| special | scipy.special |
| sqrt | numpy.sqrt |
| string | string |
| tan | numpy.tan |
| types | types |
| zeros | numpy.zeros |