536 lines (533 with data), 44.4 kB
@header@
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="matplotlib.html"><font color="#ffffff">matplotlib</font></a>.mlab</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/lib/python2.3/site-packages/matplotlib/mlab.py">/usr/local/lib/python2.3/site-packages/matplotlib/mlab.py</a></font></td></tr></table>
<p><tt>Numerical python functions written for compatability with matlab<br>
commands with the same names. <br>
<br>
Matlab compatible functions:<br>
<br>
* cohere - Coherence (normalized cross spectral density)<br>
<br>
* corrcoef - The matrix of correlation coefficients<br>
<br>
* csd - Cross spectral density uing Welch's average periodogram<br>
<br>
* detrend -- Remove the mean or best fit line from an array<br>
<br>
* find - Return the indices where some condition is true<br>
<br>
* linspace -- Linear spaced array from min to max<br>
<br>
* hist -- Histogram<br>
<br>
* polyfit - least squares best polynomial fit of x to y<br>
<br>
* polyval - evaluate a vector for a vector of polynomial coeffs<br>
<br>
* prctile - find the percentiles of a sequence<br>
<br>
* prepca - Principal Component's Analysis<br>
<br>
* psd - Power spectral density uing Welch's average periodogram<br>
<br>
* rk4 - A 4th order runge kutta integrator for 1D or ND systems<br>
<br>
* vander - the Vandermonde matrix<br>
<br>
* trapz - trapeziodal integration<br>
<br>
Functions that don't exist in matlab, but are useful anyway:<br>
<br>
* cohere_pairs - Coherence over all pairs. This is not a matlab<br>
function, but we compute coherence a lot in my lab, and we<br>
compute it for alot of pairs. This function is optimized to do<br>
this efficiently by caching the direct FFTs.<br>
<br>
Credits:<br>
<br>
Unless otherwise noted, these functions were written by<br>
Author: John D. Hunter <jdhunter@ace.bsd.uchicago.edu><br>
<br>
Some others are from the Numeric documentation, or imported from<br>
MLab or other Numeric packages</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="numarray.linear_algebra.LinearAlgebra2.html">numarray.linear_algebra.LinearAlgebra2</a><br>
<a href="numarray.linear_algebra.mlab.html">numarray.linear_algebra.mlab</a><br>
<a href="numarray.random_array.html">numarray.random_array</a><br>
<a href="numarray.arrayprint.html">numarray.arrayprint</a><br>
<a href="copy.html">copy</a><br>
<a href="copy_reg.html">copy_reg</a><br>
</td><td width="25%" valign=top><a href="numarray.generic.html">numarray.generic</a><br>
<a href="numarray.libnumarray.html">numarray.libnumarray</a><br>
<a href="math.html">math</a><br>
<a href="numarray.memory.html">numarray.memory</a><br>
<a href="numarray.numarrayall.html">numarray.numarrayall</a><br>
<a href="numarray.numarraycore.html">numarray.numarraycore</a><br>
</td><td width="25%" valign=top><a href="numarray.numerictypes.html">numarray.numerictypes</a><br>
<a href="matplotlib.numerix.html">matplotlib.numerix</a><br>
<a href="numarray.numinclude.html">numarray.numinclude</a><br>
<a href="numarray.numtest.html">numarray.numtest</a><br>
<a href="operator.html">operator</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="numarray.safethread.html">numarray.safethread</a><br>
<a href="sys.html">sys</a><br>
<a href="numarray.typeconv.html">numarray.typeconv</a><br>
<a href="types.html">types</a><br>
<a href="numarray.ufunc.html">numarray.ufunc</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-and_"><strong>and_</strong></a>(...)</dt><dd><tt><a href="#-and_">and_</a>(a, b) -- Same as a & b.</tt></dd></dl>
<dl><dt><a name="-approx_real"><strong>approx_real</strong></a>(x)</dt><dd><tt><a href="#-approx_real">approx_real</a>(x) : returns x.real if |x.imag| < |x.real| * _eps_approx.<br>
This function is needed by sqrtm and allows further functions.</tt></dd></dl>
<dl><dt><a name="-center_matrix"><strong>center_matrix</strong></a>(M, dim<font color="#909090">=0</font>)</dt><dd><tt>Return the matrix M with each row having zero mean and unit std<br>
<br>
if dim=1, center columns rather than rows</tt></dd></dl>
<dl><dt><a name="-cohere"><strong>cohere</strong></a>(x, y, NFFT<font color="#909090">=256</font>, Fs<font color="#909090">=2</font>, detrend<font color="#909090">=<function detrend_none></font>, window<font color="#909090">=<function window_hanning></font>, noverlap<font color="#909090">=0</font>)</dt><dd><tt>cohere the coherence between x and y. Coherence is the normalized<br>
cross spectral density<br>
<br>
Cxy = |Pxy|^2/(Pxx*Pyy)<br>
<br>
The return value is (Cxy, f), where f are the frequencies of the<br>
coherence vector. See the docs for psd and csd for information<br>
about the function arguments NFFT, detrend, windowm noverlap, as<br>
well as the methods used to compute Pxy, Pxx and Pyy.<br>
<br>
Returns the tuple Cxy, freqs</tt></dd></dl>
<dl><dt><a name="-cohere_pairs"><strong>cohere_pairs</strong></a>(X, ij, NFFT<font color="#909090">=256</font>, Fs<font color="#909090">=2</font>, detrend<font color="#909090">=<function detrend_none></font>, window<font color="#909090">=<function window_hanning></font>, noverlap<font color="#909090">=0</font>, preferSpeedOverMemory<font color="#909090">=True</font>, progressCallback<font color="#909090">=<function donothing_callback></font>, returnPxx<font color="#909090">=False</font>)</dt><dd><tt>Cxy, Phase, freqs = <a href="#-cohere_pairs">cohere_pairs</a>( X, ij, ...)<br>
<br>
Compute the coherence for all pairs in ij. X is a<br>
numSamples,numCols Numeric array. ij is a list of tuples (i,j).<br>
Each tuple is a pair of indexes into the columns of X for which<br>
you want to compute coherence. For example, if X has 64 columns,<br>
and you want to compute all nonredundant pairs, define ij as<br>
<br>
ij = []<br>
for i in range(64):<br>
for j in range(i+1,64):<br>
ij.append( (i,j) )<br>
<br>
The other function arguments, except for 'preferSpeedOverMemory'<br>
(see below), are explained in the help string of 'psd'.<br>
<br>
Return value is a tuple (Cxy, Phase, freqs).<br>
<br>
Cxy -- a dictionary of (i,j) tuples -> coherence vector for that<br>
pair. Ie, Cxy[(i,j) = <a href="#-cohere">cohere</a>(X[:,i], X[:,j]). Number of<br>
dictionary keys is len(ij)<br>
<br>
Phase -- a dictionary of phases of the cross spectral density at<br>
each frequency for each pair. keys are (i,j).<br>
<br>
freqs -- a vector of frequencies, equal in length to either the<br>
coherence or phase vectors for any i,j key. Eg, to make a coherence<br>
Bode plot:<br>
<br>
subplot(211)<br>
plot( freqs, Cxy[(12,19)])<br>
subplot(212)<br>
plot( freqs, Phase[(12,19)])<br>
<br>
For a large number of pairs, cohere_pairs can be much more<br>
efficient than just calling cohere for each pair, because it<br>
caches most of the intensive computations. If N is the number of<br>
pairs, this function is O(N) for most of the heavy lifting,<br>
whereas calling cohere for each pair is O(N^2). However, because<br>
of the caching, it is also more memory intensive, making 2<br>
additional complex arrays with approximately the same number of<br>
elements as X.<br>
<br>
The parameter 'preferSpeedOverMemory', if false, limits the<br>
caching by only making one, rather than two, complex cache arrays.<br>
This is useful if memory becomes critical. Even when<br>
preferSpeedOverMemory is false, cohere_pairs will still give<br>
significant performace gains over calling cohere for each pair,<br>
and will use subtantially less memory than if<br>
preferSpeedOverMemory is true. In my tests with a 43000,64 array<br>
over all nonredundant pairs, preferSpeedOverMemory=1 delivered a<br>
33% performace boost on a 1.7GHZ Athlon with 512MB RAM compared<br>
with preferSpeedOverMemory=0. But both solutions were more than<br>
10x faster than naievly crunching all possible pairs through<br>
cohere.<br>
<br>
See test/cohere_pairs_test.py in the src tree for an example<br>
script that shows that this cohere_pairs and cohere give the same<br>
results for a given pair.</tt></dd></dl>
<dl><dt><a name="-corrcoef"><strong>corrcoef</strong></a>(*args)</dt><dd><tt><a href="#-corrcoef">corrcoef</a>(X) where X is a matrix returns a matrix of correlation<br>
coefficients for each row of X.<br>
<br>
<a href="#-corrcoef">corrcoef</a>(x,y) where x and y are vectors returns the matrix or<br>
correlation coefficients for x and y.<br>
<br>
Numeric arrays can be real or complex<br>
<br>
The correlation matrix is defined from the covariance matrix C as<br>
<br>
r(i,j) = C[i,j] / (C[i,i]*C[j,j])</tt></dd></dl>
<dl><dt><a name="-csd"><strong>csd</strong></a>(x, y, NFFT<font color="#909090">=256</font>, Fs<font color="#909090">=2</font>, detrend<font color="#909090">=<function detrend_none></font>, window<font color="#909090">=<function window_hanning></font>, noverlap<font color="#909090">=0</font>)</dt><dd><tt>The cross spectral density Pxy by Welches average periodogram<br>
method. The vectors x and y are divided into NFFT length<br>
segments. Each segment is detrended by function detrend and<br>
windowed by function window. noverlap gives the length of the<br>
overlap between segments. The product of the direct FFTs of x and<br>
y are averaged over each segment to compute Pxy, with a scaling to<br>
correct for power loss due to windowing. Fs is the sampling<br>
frequency.<br>
<br>
NFFT must be a power of 2<br>
<br>
Returns the tuple Pxy, freqs<br>
<br>
<br>
<br>
Refs:<br>
Bendat & Piersol -- Random Data: Analysis and Measurement<br>
Procedures, John Wiley & Sons (1986)</tt></dd></dl>
<dl><dt><a name="-cumproduct"><strong>cumproduct</strong></a> = accumulate(...)</dt><dd><tt>accumulate performs the operation along the dimension, accumulating subtotals</tt></dd></dl>
<dl><dt><a name="-detrend"><strong>detrend</strong></a>(x, key<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="-detrend_linear"><strong>detrend_linear</strong></a>(x)</dt><dd><tt>Return x minus best fit line; 'linear' detrending</tt></dd></dl>
<dl><dt><a name="-detrend_mean"><strong>detrend_mean</strong></a>(x)</dt><dd><tt>Return x minus the <a href="#-mean">mean</a>(x)</tt></dd></dl>
<dl><dt><a name="-detrend_none"><strong>detrend_none</strong></a>(x)</dt><dd><tt>Return x: no detrending</tt></dd></dl>
<dl><dt><a name="-donothing_callback"><strong>donothing_callback</strong></a>(*args)</dt></dl>
<dl><dt><a name="-entropy"><strong>entropy</strong></a>(y, bins)</dt><dd><tt>Return the entropy of the data in y<br>
<br>
\sum p_i log2(p_i) where p_i is the probability of observing y in<br>
the ith bin of bins. bins can be a number of bins or a range of<br>
bins; see hist<br>
<br>
Compare S with analytic calculation for a Gaussian<br>
x = mu + sigma*randn(200000)<br>
Sanalytic = 0.5 * ( 1.0 + log(2*pi*sigma**2.0) )</tt></dd></dl>
<dl><dt><a name="-find"><strong>find</strong></a>(condition)</dt><dd><tt>Return the indices where condition is true</tt></dd></dl>
<dl><dt><a name="-fix"><strong>fix</strong></a>(x)</dt><dd><tt>Rounds towards zero.<br>
x_rounded = <a href="#-fix">fix</a>(x) rounds the elements of x to the nearest integers<br>
towards zero.<br>
For negative numbers is equivalent to ceil and for positive to floor.</tt></dd></dl>
<dl><dt><a name="-hist"><strong>hist</strong></a>(y, bins<font color="#909090">=10</font>, normed<font color="#909090">=0</font>)</dt><dd><tt>Return the histogram of y with bins equally sized bins. If bins<br>
is an array, use the bins. Return value is<br>
(n,x) where n is the count for each bin in x<br>
<br>
If normed is False, return the counts in the first element of the<br>
return tuple. If normed is True, return the probability density<br>
n/(len(y)*dbin)<br>
<br>
Credits: the Numeric 22 documentation</tt></dd></dl>
<dl><dt><a name="-levypdf"><strong>levypdf</strong></a>(x, gamma, alpha)</dt><dd><tt>Returm the levy pdf evaluated at x for params gamma, alpha</tt></dd></dl>
<dl><dt><a name="-linspace"><strong>linspace</strong></a>(xmin, xmax, N)</dt></dl>
<dl><dt><a name="-longest_contiguous_ones"><strong>longest_contiguous_ones</strong></a>(x)</dt><dd><tt>return the indicies of the longest stretch of contiguous ones in x,<br>
assuming x is a vector of zeros and ones.</tt></dd></dl>
<dl><dt><a name="-longest_ones"><strong>longest_ones</strong></a>(x)</dt><dd><tt>return the indicies of the longest stretch of contiguous ones in x,<br>
assuming x is a vector of zeros and ones.<br>
<br>
If there are two equally long stretches, pick the first</tt></dd></dl>
<dl><dt><a name="-mean"><strong>mean</strong></a>(x, dim<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="-meshgrid"><strong>meshgrid</strong></a>(x, y)</dt><dd><tt>For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y<br>
where X and Y are (Ny, Nx) shaped arrays with the elements of x<br>
and y repeated to fill the matrix<br>
<br>
EG,<br>
<br>
[X, Y] = <a href="#-meshgrid">meshgrid</a>([1,2,3], [4,5,6,7])<br>
<br>
X =<br>
1 2 3<br>
1 2 3<br>
1 2 3<br>
1 2 3<br>
<br>
<br>
Y =<br>
4 4 4<br>
5 5 5<br>
6 6 6<br>
7 7 7</tt></dd></dl>
<dl><dt><a name="-mfuncC"><strong>mfuncC</strong></a>(f, x)</dt><dd><tt><a href="#-mfuncC">mfuncC</a>(f, x) : matrix function with possibly complex eigenvalues.<br>
Note: Numeric defines (v,u) = eig(x) => x*u.T = u.T * Diag(v)<br>
This function is needed by sqrtm and allows further functions.</tt></dd></dl>
<dl><dt><a name="-norm"><strong>norm</strong></a>(x, y<font color="#909090">=2</font>)</dt><dd><tt>Norm of a matrix or a vector according to Matlab.<br>
The description is taken from Matlab:<br>
<br>
For matrices...<br>
NORM(X) is the largest singular value of X, max(svd(X)).<br>
NORM(X,2) is the same as NORM(X).<br>
NORM(X,1) is the 1-norm of X, the largest column sum,<br>
= max(<a href="#-sum">sum</a>(abs((X)))).<br>
NORM(X,inf) is the infinity norm of X, the largest row sum,<br>
= max(<a href="#-sum">sum</a>(abs((X')))).<br>
NORM(X,'fro') is the Frobenius norm, sqrt(<a href="#-sum">sum</a>(diag(X'*X))).<br>
NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.<br>
<br>
For vectors...<br>
NORM(V,P) = <a href="#-sum">sum</a>(abs(V).^P)^(1/P).<br>
NORM(V) = <a href="#-norm">norm</a>(V,2).<br>
NORM(V,inf) = max(abs(V)).<br>
NORM(V,-inf) = min(abs(V)).</tt></dd></dl>
<dl><dt><a name="-normpdf"><strong>normpdf</strong></a>(x, *args)</dt><dd><tt>Return the normal pdf evaluated at x; args provides mu, sigma</tt></dd></dl>
<dl><dt><a name="-orth"><strong>orth</strong></a>(A)</dt><dd><tt>Orthogonalization procedure by Matlab.<br>
The description is taken from its help:<br>
<br>
Q = ORTH(A) is an orthonormal basis for the range of A.<br>
That is, Q'*Q = I, the columns of Q span the same space as <br>
the columns of A, and the number of columns of Q is the <br>
rank of A.</tt></dd></dl>
<dl><dt><a name="-polyfit"><strong>polyfit</strong></a>(x, y, N)</dt><dd><tt>Do a best fit polynomial of order N of y to x. Return value is a<br>
vector of polynomial coefficients [pk ... p1 p0]. Eg, for N=2<br>
<br>
p2*x0^2 + p1*x0 + p0 = y1<br>
p2*x1^2 + p1*x1 + p0 = y1<br>
p2*x2^2 + p1*x2 + p0 = y2<br>
.....<br>
p2*xk^2 + p1*xk + p0 = yk<br>
<br>
<br>
Method: if X is a the Vandermonde Matrix computed from x (see<br>
<a href="http://mathworld.wolfram.com/VandermondeMatrix.html">http://mathworld.wolfram.com/VandermondeMatrix.html</a>), then the<br>
polynomial least squares solution is given by the 'p' in<br>
<br>
X*p = y<br>
<br>
where X is a len(x) x N+1 matrix, p is a N+1 length vector, and y<br>
is a len(x) x 1 vector<br>
<br>
This equation can be solved as<br>
<br>
p = (XT*X)^-1 * XT * y<br>
<br>
where XT is the transpose of X and -1 denotes the inverse.<br>
<br>
For more info, see<br>
<a href="http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html">http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html</a>,<br>
but note that the k's and n's in the superscripts and subscripts<br>
on that page. The linear algebra is correct, however.<br>
<br>
See also polyval</tt></dd></dl>
<dl><dt><a name="-polyval"><strong>polyval</strong></a>(p, x)</dt><dd><tt>y = <a href="#-polyval">polyval</a>(p,x)<br>
<br>
p is a vector of polynomial coeffients and y is the polynomial<br>
evaluated at x.<br>
<br>
Example code to remove a polynomial (quadratic) trend from y:<br>
<br>
p = <a href="#-polyfit">polyfit</a>(x, y, 2)<br>
trend = <a href="#-polyval">polyval</a>(p, x)<br>
resid = y - trend<br>
<br>
See also polyfit</tt></dd></dl>
<dl><dt><a name="-prctile"><strong>prctile</strong></a>(x, p<font color="#909090">=(0.0, 25.0, 50.0, 75.0, 100.0)</font>)</dt><dd><tt>Return the percentiles of x. p can either be a sequence of<br>
percentil values or a scalar. If p is a sequence the i-th element<br>
of the return sequence is the p(i)-th percentile of x</tt></dd></dl>
<dl><dt><a name="-prepca"><strong>prepca</strong></a>(P, frac<font color="#909090">=0</font>)</dt><dd><tt>Compute the principal components of P. P is a numVars x<br>
numObservations numeric array. frac is the minimum fraction of<br>
variance that a component must contain to be included<br>
<br>
Return value are<br>
Pcomponents : a num components x num observations numeric array<br>
Trans : the weights matrix, ie, Pcomponents = Trans*P<br>
fracVar : the fraction of the variance accounted for by each<br>
component returned</tt></dd></dl>
<dl><dt><a name="-product"><strong>product</strong></a> = reduce(...)</dt><dd><tt>reduce performs the operation along the specified dimension, eliminating it. Returns scalars rather than rank-0 numarray.</tt></dd></dl>
<dl><dt><a name="-psd"><strong>psd</strong></a>(x, NFFT<font color="#909090">=256</font>, Fs<font color="#909090">=2</font>, detrend<font color="#909090">=<function detrend_none></font>, window<font color="#909090">=<function window_hanning></font>, noverlap<font color="#909090">=0</font>)</dt><dd><tt>The power spectral density by Welches average periodogram method.<br>
The vector x is divided into NFFT length segments. Each segment<br>
is detrended by function detrend and windowed by function window.<br>
noperlap gives the length of the overlap between segments. The<br>
absolute(fft(segment))**2 of each segment are averaged to compute Pxx,<br>
with a scaling to correct for power loss due to windowing. Fs is<br>
the sampling frequency.<br>
<br>
-- NFFT must be a power of 2<br>
-- detrend and window are functions, unlike in matlab where they are<br>
vectors.<br>
-- if length x < NFFT, it will be zero padded to NFFT<br>
<br>
<br>
Returns the tuple Pxx, freqs<br>
<br>
Refs:<br>
Bendat & Piersol -- Random Data: Analysis and Measurement<br>
Procedures, John Wiley & Sons (1986)</tt></dd></dl>
<dl><dt><a name="-rank"><strong>rank</strong></a>(x)</dt><dd><tt>Returns the rank of a matrix.<br>
The rank is understood here as the an estimation of the number of<br>
linearly independent rows or columns (depending on the size of the<br>
matrix).<br>
Note that MLab.<a href="#-rank">rank</a>() is not equivalent to Matlab's rank.<br>
This function is!</tt></dd></dl>
<dl><dt><a name="-rem"><strong>rem</strong></a>(x, y)</dt><dd><tt>Remainder after division.<br>
<a href="#-rem">rem</a>(x,y) is equivalent to x - y.*<a href="#-fix">fix</a>(x./y) in case y is not zero.<br>
By convention, <a href="#-rem">rem</a>(x,0) returns None.<br>
We keep the convention by Matlab:<br>
"The input x and y must be real arrays of the same size, or real scalars."</tt></dd></dl>
<dl><dt><a name="-rk4"><strong>rk4</strong></a>(derivs, y0, t)</dt><dd><tt>Integrate 1D or ND system of ODEs from initial state y0 at sample<br>
times t. derivs returns the derivative of the system and has the<br>
signature<br>
<br>
dy = derivs(yi, ti)<br>
<br>
Example 1 :<br>
<br>
## 2D system<br>
# Numeric solution<br>
def derivs6(x,t):<br>
d1 = x[0] + 2*x[1]<br>
d2 = -3*x[0] + 4*x[1]<br>
return (d1, d2)<br>
dt = 0.0005<br>
t = arange(0.0, 2.0, dt)<br>
y0 = (1,2)<br>
yout = <a href="#-rk4">rk4</a>(derivs6, y0, t)<br>
<br>
Example 2:<br>
<br>
## 1D system<br>
alpha = 2<br>
def derivs(x,t):<br>
return -alpha*x + exp(-t)<br>
<br>
y0 = 1<br>
yout = <a href="#-rk4">rk4</a>(derivs, y0, t)</tt></dd></dl>
<dl><dt><a name="-specgram"><strong>specgram</strong></a>(x, NFFT<font color="#909090">=256</font>, Fs<font color="#909090">=2</font>, detrend<font color="#909090">=<function detrend_none></font>, window<font color="#909090">=<function window_hanning></font>, noverlap<font color="#909090">=128</font>)</dt><dd><tt>Compute a spectrogram of data in x. Data are split into NFFT<br>
length segements and the PSD of each section is computed. The<br>
windowing function window is applied to each segment, and the<br>
amount of overlap of each segment is specified with noverlap<br>
<br>
See pdf for more info.<br>
<br>
The returned times are the midpoints of the intervals over which<br>
the ffts are calculated</tt></dd></dl>
<dl><dt><a name="-sqrtm"><strong>sqrtm</strong></a>(x)</dt><dd><tt>Returns the square root of a square matrix.<br>
This means that s=<a href="#-sqrtm">sqrtm</a>(x) implies s*s = x.<br>
Note that s and x are matrices.</tt></dd></dl>
<dl><dt><a name="-sum"><strong>sum</strong></a> = reduce(...)</dt><dd><tt>reduce performs the operation along the specified dimension, eliminating it. Returns scalars rather than rank-0 numarray.</tt></dd></dl>
<dl><dt><a name="-trapz"><strong>trapz</strong></a>(x, y)</dt></dl>
<dl><dt><a name="-vander"><strong>vander</strong></a>(x, N<font color="#909090">=None</font>)</dt><dd><tt>X = <a href="#-vander">vander</a>(x,N=None)<br>
<br>
The Vandermonde matrix of vector x. The i-th column of X is the<br>
the i-th power of x. N is the maximum power to compute; if N is<br>
None it defaults to len(x).</tt></dd></dl>
<dl><dt><a name="-window_hanning"><strong>window_hanning</strong></a>(x)</dt><dd><tt>return x times the hanning window of len(x)</tt></dd></dl>
<dl><dt><a name="-window_none"><strong>window_none</strong></a>(x)</dt><dd><tt>No window function; simply return x</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>Any</strong> = Any<br>
<strong>Bool</strong> = Bool<br>
<strong>Byte</strong> = Int8<br>
<strong>CLIP</strong> = 0<br>
<strong>Complex</strong> = Complex64<br>
<strong>Complex32</strong> = Complex32<br>
<strong>Complex64</strong> = Complex64<br>
<strong>Error</strong> = <numarray.ufunc.NumError instance><br>
<strong>False</strong> = False<br>
<strong>Float</strong> = Float64<br>
<strong>Float32</strong> = Float32<br>
<strong>Float64</strong> = Float64<br>
<strong>Int</strong> = Int32<br>
<strong>Int16</strong> = Int16<br>
<strong>Int32</strong> = Int32<br>
<strong>Int64</strong> = Int64<br>
<strong>Int8</strong> = Int8<br>
<strong>Long</strong> = Int32<br>
<strong>MAX_ALIGN</strong> = 8<br>
<strong>MAX_INT_SIZE</strong> = 8<br>
<strong>MAX_LINE_WIDTH</strong> = None<br>
<strong>MaybeLong</strong> = Int32<br>
<strong>NewAxis</strong> = None<br>
<strong>Object</strong> = Object<br>
<strong>PRECISION</strong> = None<br>
<strong>Py2NumType</strong> = {<type 'float'>: Float64, <type 'int'>: Int32, <type 'long'>: Int32, <type 'bool'>: Bool, <type 'complex'>: Complex64}<br>
<strong>PyINT_TYPES</strong> = {<type 'int'>: 1, <type 'long'>: 1, <type 'bool'>: 1}<br>
<strong>PyLevel2Type</strong> = {-1: <type 'bool'>, 0: <type 'int'>, 1: <type 'long'>, 2: <type 'float'>, 3: <type 'complex'>}<br>
<strong>PyNUMERIC_TYPES</strong> = {<type 'float'>: 2, <type 'int'>: 0, <type 'long'>: 1, <type 'bool'>: -1, <type 'complex'>: 3}<br>
<strong>PyREAL_TYPES</strong> = {<type 'float'>: 1, <type 'int'>: 1, <type 'long'>: 1, <type 'bool'>: 1}<br>
<strong>RAISE</strong> = 2<br>
<strong>SUPPRESS_SMALL</strong> = None<br>
<strong>Short</strong> = Int16<br>
<strong>True</strong> = True<br>
<strong>UInt16</strong> = UInt16<br>
<strong>UInt32</strong> = UInt32<br>
<strong>UInt64</strong> = UInt64<br>
<strong>UInt8</strong> = UInt8<br>
<strong>WRAP</strong> = 1<br>
<strong>a</strong> = 'matplotlib.transforms'<br>
<strong>abs</strong> = <UFunc: 'abs'><br>
<strong>absolute</strong> = <UFunc: 'abs'><br>
<strong>add</strong> = <UFunc: 'add'><br>
<strong>arccos</strong> = <UFunc: 'arccos'><br>
<strong>arccosh</strong> = <UFunc: 'arccosh'><br>
<strong>arcsin</strong> = <UFunc: 'arcsin'><br>
<strong>arcsinh</strong> = <UFunc: 'arcsinh'><br>
<strong>arctan</strong> = <UFunc: 'arctan'><br>
<strong>arctan2</strong> = <UFunc: 'arctan2'><br>
<strong>arctanh</strong> = <UFunc: 'arctanh'><br>
<strong>bitwise_and</strong> = <UFunc: 'bitwise_and'><br>
<strong>bitwise_not</strong> = <UFunc: 'bitwise_not'><br>
<strong>bitwise_or</strong> = <UFunc: 'bitwise_or'><br>
<strong>bitwise_xor</strong> = <UFunc: 'bitwise_xor'><br>
<strong>ceil</strong> = <UFunc: 'ceil'><br>
<strong>cos</strong> = <UFunc: 'cos'><br>
<strong>cosh</strong> = <UFunc: 'cosh'><br>
<strong>divide</strong> = <UFunc: 'divide'><br>
<strong>division</strong> = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)<br>
<strong>e</strong> = 2.7182818284590451<br>
<strong>equal</strong> = <UFunc: 'equal'><br>
<strong>exp</strong> = <UFunc: 'exp'><br>
<strong>fabs</strong> = <UFunc: 'fabs'><br>
<strong>floor</strong> = <UFunc: 'floor'><br>
<strong>fmod</strong> = <UFunc: 'remainder'><br>
<strong>genericCoercions</strong> = {('Bool', 'Bool'): 'Bool', ('Bool', 'Complex32'): 'Complex32', ('Bool', 'Complex64'): 'Complex64', ('Bool', 'Float32'): 'Float32', ('Bool', 'Float64'): 'Float64', ('Bool', 'Int16'): 'Int16', ('Bool', 'Int32'): 'Int32', ('Bool', 'Int64'): 'Int64', ('Bool', 'Int8'): 'Int8', ('Bool', 'Object'): 'Object', ...}<br>
<strong>genericPromotionExclusions</strong> = {'Bool': (), 'Complex32': (), 'Complex64': (), 'Float32': (), 'Float64': (11,), 'Int16': (), 'Int32': (), 'Int64': (9,), 'Int8': (), 'UInt16': (), ...}<br>
<strong>genericTypeRank</strong> = ['Bool', 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32', 'Int64', 'UInt64', 'Float32', 'Float64', 'Complex32', 'Complex64', 'Object']<br>
<strong>greater</strong> = <UFunc: 'greater'><br>
<strong>greater_equal</strong> = <UFunc: 'greater_equal'><br>
<strong>hypot</strong> = <UFunc: 'hypot'><br>
<strong>ieeemask</strong> = <UFunc: 'ieeemask'><br>
<strong>isBigEndian</strong> = False<br>
<strong>less</strong> = <UFunc: 'less'><br>
<strong>less_equal</strong> = <UFunc: 'less_equal'><br>
<strong>log</strong> = <UFunc: 'log'><br>
<strong>log10</strong> = <UFunc: 'log10'><br>
<strong>logical_and</strong> = <UFunc: 'logical_and'><br>
<strong>logical_not</strong> = <UFunc: 'logical_not'><br>
<strong>logical_or</strong> = <UFunc: 'logical_or'><br>
<strong>logical_xor</strong> = <UFunc: 'logical_xor'><br>
<strong>lshift</strong> = <UFunc: 'lshift'><br>
<strong>maximum</strong> = <UFunc: 'maximum'><br>
<strong>minimum</strong> = <UFunc: 'minimum'><br>
<strong>minus</strong> = <UFunc: 'minus'><br>
<strong>multiply</strong> = <UFunc: 'multiply'><br>
<strong>negative</strong> = <UFunc: 'minus'><br>
<strong>not_equal</strong> = <UFunc: 'not_equal'><br>
<strong>numarray_nonzero</strong> = <numarray.ufunc._NonzeroUFunc instance><br>
<strong>pi</strong> = 3.1415926535897931<br>
<strong>power</strong> = <UFunc: 'power'><br>
<strong>pythonTypeMap</strong> = {<type 'float'>: ('Float64', 'float'), <type 'int'>: ('Int32', 'int'), <type 'long'>: ('Int32', 'int'), <type 'complex'>: ('Complex64', 'complex')}<br>
<strong>pythonTypeRank</strong> = [<type 'int'>, <type 'long'>, <type 'float'>, <type 'complex'>]<br>
<strong>rcParams</strong> = {'axes.edgecolor': 'k', 'axes.facecolor': 'w', 'axes.grid': False, 'axes.labelcolor': 'k', 'axes.labelsize': 12.0, 'axes.linewidth': 0.5, 'axes.titlesize': 14.0, 'backend': 'GTKAgg', 'datapath': '/usr/local/share/matplotlib', 'figure.dpi': 80.0, ...}<br>
<strong>readme</strong> = '<font color="#c040c0">\n</font>MLab2.py, release 1<font color="#c040c0">\n\n</font>Created on February 2003 b...<font color="#c040c0">\n</font>Look at: http://pdilib.sf.net for new releases.<font color="#c040c0">\n</font>'<br>
<strong>remainder</strong> = <UFunc: 'remainder'><br>
<strong>rshift</strong> = <UFunc: 'rshift'><br>
<strong>scalarTypeMap</strong> = {<type 'float'>: 'Float64', <type 'int'>: 'Int32', <type 'long'>: 'Int32', <type 'complex'>: 'Complex64'}<br>
<strong>sin</strong> = <UFunc: 'sin'><br>
<strong>sinh</strong> = <UFunc: 'sinh'><br>
<strong>sqrt</strong> = <UFunc: 'sqrt'><br>
<strong>subtract</strong> = <UFunc: 'subtract'><br>
<strong>tan</strong> = <UFunc: 'tan'><br>
<strong>tanh</strong> = <UFunc: 'tanh'><br>
<strong>typeDict</strong> = {'1': Int8, 'Any': Any, 'Bool': Bool, 'Byte': Int8, 'Complex': Complex64, 'Complex32': Complex32, 'Complex64': Complex64, 'D': Complex64, 'F': Complex32, 'Float': Float64, ...}<br>
<strong>typecode</strong> = {Bool: '1', Int8: '1', UInt8: 'b', Int16: 's', UInt16: 'w', Int32: 'l', Int64: 'N', Float32: 'f', Float64: 'd', Complex32: 'F', ...}<br>
<strong>typecodes</strong> = {'Character': 'c', 'Complex': 'FD', 'Float': 'fd', 'Integer': '1silN', 'UnsignedInteger': 'bwu'}<br>
<strong>which</strong> = ('numarray', 'rc')</td></tr></table>
@footer@