You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v2.1.1). For the latest version see <ahref="https://matplotlib.org/stable/api/mlab_api.html">https://matplotlib.org/stable/api/mlab_api.html</a></div>
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatBool</code><aclass="headerlink" href="#matplotlib.mlab.FormatBool" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fromstr</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatBool.fromstr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatBool.toval">
<codeclass="descname">toval</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatBool.toval" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatDate">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatDate</code><spanclass="sig-paren">(</span><em>fmt</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatDate" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fromstr</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatDate.fromstr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatDate.toval">
<codeclass="descname">toval</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatDate.toval" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatDatetime">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatDatetime</code><spanclass="sig-paren">(</span><em>fmt='%Y-%m-%d %H:%M:%S'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatDatetime" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fromstr</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatDatetime.fromstr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatFloat">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatFloat</code><spanclass="sig-paren">(</span><em>precision=4</em>, <em>scale=1.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatFloat" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fromstr</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatFloat.fromstr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatFloat.toval">
<codeclass="descname">toval</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatFloat.toval" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatFormatStr">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatFormatStr</code><spanclass="sig-paren">(</span><em>fmt</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatFormatStr" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tostr</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatFormatStr.tostr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatInt">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatInt</code><aclass="headerlink" href="#matplotlib.mlab.FormatInt" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fromstr</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatInt.fromstr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatInt.tostr">
<codeclass="descname">tostr</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatInt.tostr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatInt.toval">
<codeclass="descname">toval</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatInt.toval" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatMillions">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatMillions</code><spanclass="sig-paren">(</span><em>precision=4</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatMillions" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatObj</code><aclass="headerlink" href="#matplotlib.mlab.FormatObj" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">fromstr</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatObj.fromstr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatObj.tostr">
<codeclass="descname">tostr</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatObj.tostr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.FormatObj.toval">
<codeclass="descname">toval</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatObj.toval" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatPercent">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatPercent</code><spanclass="sig-paren">(</span><em>precision=4</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatPercent" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatString</code><aclass="headerlink" href="#matplotlib.mlab.FormatString" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">tostr</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatString.tostr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.FormatThousands">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">FormatThousands</code><spanclass="sig-paren">(</span><em>precision=4</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.FormatThousands" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">GaussianKDE</code><spanclass="sig-paren">(</span><em>dataset</em>, <em>bw_method=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.GaussianKDE" title="Permalink to this definition">¶</a></dt>
<div><p>Datapoints to estimate from. In case of univariate data this is a 1-D
array, otherwise a 2-D array with shape (# of dims, # of data).</p>
</div></blockquote>
<p><strong>bw_method</strong> : str, scalar or callable, optional</p>
<blockquoteclass="last">
<div><p>The method used to calculate the estimator bandwidth. This can be
‘scott’, ‘silverman’, a scalar constant or a callable. If a
scalar, this will be used directly as <codeclass="xref py py-obj docutils literal"><spanclass="pre">kde.factor</span></code>. If a
callable, it should take a <aclass="reference internal" href="#matplotlib.mlab.GaussianKDE" title="matplotlib.mlab.GaussianKDE"><codeclass="xref py py-obj docutils literal"><spanclass="pre">GaussianKDE</span></code></a> instance as only
parameter and return a scalar. If None (default), ‘scott’ is used.</p>
<td>(float) The bandwidth factor, obtained from <codeclass="xref py py-obj docutils literal"><spanclass="pre">kde.covariance_factor</span></code>, with which the covariance matrix is multiplied.</td>
<td>(ndarray) The covariance matrix of <codeclass="xref py py-obj docutils literal"><spanclass="pre">dataset</span></code>, scaled by the calculated bandwidth (<codeclass="xref py py-obj docutils literal"><spanclass="pre">kde.factor</span></code>).</td>
<codeclass="descname">covariance_factor</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.GaussianKDE.covariance_factor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.GaussianKDE.evaluate">
<codeclass="descname">evaluate</code><spanclass="sig-paren">(</span><em>points</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.GaussianKDE.evaluate" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate the estimated pdf on a set of points.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><pclass="first"><strong>points</strong> : (# of dimensions, # of points)-array</p>
<blockquote>
<div><p>Alternatively, a (# of dimensions,) vector can be passed in and
treated as a single point.</p>
</div></blockquote>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first"><strong>values</strong> : (# of points,)-array</p>
<blockquote>
<div><p>The values at each point.</p>
</div></blockquote>
</td>
</tr>
<trclass="field-odd field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first"><strong>ValueError</strong> : if the dimensionality of the input points is different</p>
<codeclass="descname">scotts_factor</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.GaussianKDE.scotts_factor" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">silverman_factor</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.GaussianKDE.silverman_factor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.mlab.PCA">
<emclass="property">class </em><codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">PCA</code><spanclass="sig-paren">(</span><em>a</em>, <em>standardize=True</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.PCA" title="Permalink to this definition">¶</a></dt>
<td>The dimensions of <codeclass="docutils literal"><spanclass="pre">a</span></code>.</td>
</tr>
<trclass="row-odd"><td><strong>mu</strong></td>
<td>A numdims array of means of <codeclass="docutils literal"><spanclass="pre">a</span></code>. This is the vector that points to the origin of PCA space.</td>
<td>The proportion of variance of each of the principal components.</td>
</tr>
<trclass="row-even"><td><strong>s</strong></td>
<td>The actual eigenvalues of the decomposition.</td>
</tr>
<trclass="row-odd"><td><strong>Wt</strong></td>
<td>The weight vector for projecting a numdims point or array into PCA space.</td>
</tr>
<trclass="row-even"><td><strong>Y</strong></td>
<td>A projected into PCA space.</td>
</tr>
</tbody>
</table>
<dlclass="method">
<dtid="matplotlib.mlab.PCA.center">
<codeclass="descname">center</code><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.PCA.center" title="Permalink to this definition">¶</a></dt>
<dd><p>center and optionally standardize the data using the mean and sigma
from training set a</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.mlab.PCA.project">
<codeclass="descname">project</code><spanclass="sig-paren">(</span><em>x</em>, <em>minfrac=0.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.PCA.project" title="Permalink to this definition">¶</a></dt>
<dd><p>project x onto the principle axes, dropping any axes where fraction
of variance<minfrac</p>
</dd></dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.amap">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">amap</code><spanclass="sig-paren">(</span><em>function</em>, <em>sequence</em><spanclass="optional">[</span>, <em>sequence</em>, <em>...</em><spanclass="optional">]</span><spanclass="sig-paren">)</span> → array.<aclass="headerlink" href="#matplotlib.mlab.amap" title="Permalink to this definition">¶</a></dt>
<dd><p>Works like <aclass="reference external" href="https://docs.python.org/3/library/functions.html#map" title="(in Python v3.6)"><codeclass="xref py py-func docutils literal"><spanclass="pre">map()</span></code></a>, but it returns an array. This is just a
convenient shorthand for <codeclass="docutils literal"><spanclass="pre">numpy.array(map(...))</span></code>.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.angle_spectrum">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">angle_spectrum</code><spanclass="sig-paren">(</span><em>x</em>, <em>Fs=None</em>, <em>window=None</em>, <em>pad_to=None</em>, <em>sides=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.angle_spectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the angle of the frequency spectrum (wrapped phase spectrum) of
<em>x</em>. Data is padded to a length of <em>pad_to</em> and the windowing function
<aclass="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window" title="(in SciPy v1.0.0)"><codeclass="xref py py-func docutils literal"><spanclass="pre">scipy.signal.get_window()</span></code></a>, etc. The default is
<aclass="reference internal" href="#matplotlib.mlab.window_hanning" title="matplotlib.mlab.window_hanning"><codeclass="xref py py-func docutils literal"><spanclass="pre">window_hanning()</span></code></a>. If a function is passed as the
argument, it must take a data segment as an argument and
<dd>This function returns the angle value of <aclass="reference internal" href="#matplotlib.mlab.complex_spectrum" title="matplotlib.mlab.complex_spectrum"><codeclass="xref py py-func docutils literal"><spanclass="pre">complex_spectrum()</span></code></a>.</dd>
<dd><aclass="reference internal" href="#matplotlib.mlab.angle_spectrum" title="matplotlib.mlab.angle_spectrum"><codeclass="xref py py-func docutils literal"><spanclass="pre">angle_spectrum()</span></code></a> returns the magnitudes of the corresponding frequencies.</dd>
<dd><aclass="reference internal" href="#matplotlib.mlab.phase_spectrum" title="matplotlib.mlab.phase_spectrum"><codeclass="xref py py-func docutils literal"><spanclass="pre">phase_spectrum()</span></code></a> returns the unwrapped version of this function.</dd>
<dd><aclass="reference internal" href="#matplotlib.mlab.specgram" title="matplotlib.mlab.specgram"><codeclass="xref py py-func docutils literal"><spanclass="pre">specgram()</span></code></a> can return the angle spectrum of segments within the signal.</dd>
</dl>
</div>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.apply_window">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">apply_window</code><spanclass="sig-paren">(</span><em>x</em>, <em>window</em>, <em>axis=0</em>, <em>return_window=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.apply_window" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply the given window to the given 1D or 2D array along the given axis.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><pclass="first"><strong>x</strong> : 1D or 2D array or sequence</p>
<blockquote>
<div><p>Array or sequence containing the data.</p>
</div></blockquote>
<p><strong>window</strong> : function or array.</p>
<blockquote>
<div><p>Either a function to generate a window or an array with length
<em>x</em>.shape[<em>axis</em>]</p>
</div></blockquote>
<p><strong>axis</strong> : integer</p>
<blockquote>
<div><p>The axis over which to do the repetition.
Must be 0 or 1. The default is 0</p>
</div></blockquote>
<p><strong>return_window</strong> : bool</p>
<blockquoteclass="last">
<div><p>If true, also return the 1D values of the window that was applied</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.base_repr">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">base_repr</code><spanclass="sig-paren">(</span><em>number</em>, <em>base=2</em>, <em>padding=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.base_repr" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the representation of a <em>number</em> in any given <em>base</em>.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.binary_repr">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">binary_repr</code><spanclass="sig-paren">(</span><em>number</em>, <em>max_length=1025</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.binary_repr" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the binary representation of the input <em>number</em> as a
string.</p>
<p>This is more efficient than using <aclass="reference internal" href="#matplotlib.mlab.base_repr" title="matplotlib.mlab.base_repr"><codeclass="xref py py-func docutils literal"><spanclass="pre">base_repr()</span></code></a> with base 2.</p>
<p>Increase the value of max_length for very large numbers. Note that
on 32-bit machines, 2**1023 is the largest integer power of 2
which can be converted to a Python float.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.bivariate_normal">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">bivariate_normal</code><spanclass="sig-paren">(</span><em>X</em>, <em>Y</em>, <em>sigmax=1.0</em>, <em>sigmay=1.0</em>, <em>mux=0.0</em>, <em>muy=0.0</em>, <em>sigmaxy=0.0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.bivariate_normal" title="Permalink to this definition">¶</a></dt>
<dd><p>Bivariate Gaussian distribution for equal shape <em>X</em>, <em>Y</em>.</p>
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">center_matrix</code><spanclass="sig-paren">(</span><em>M</em>, <em>dim=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.center_matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the matrix <em>M</em> with each row having zero mean and unit std.</p>
<p>If <em>dim</em> = 1 operate on columns instead of rows. (<em>dim</em> is
opposite to the numpy axis kwarg.)</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.cohere">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">cohere</code><spanclass="sig-paren">(</span><em>x</em>, <em>y</em>, <em>NFFT=256</em>, <em>Fs=2</em>, <em>detrend=<function detrend_none></em>, <em>window=<function window_hanning></em>, <em>noverlap=0</em>, <em>pad_to=None</em>, <em>sides='default'</em>, <em>scale_by_freq=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.cohere" title="Permalink to this definition">¶</a></dt>
<dd><p>The coherence between <em>x</em> and <em>y</em>. Coherence is the normalized
<aclass="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window" title="(in SciPy v1.0.0)"><codeclass="xref py py-func docutils literal"><spanclass="pre">scipy.signal.get_window()</span></code></a>, etc. The default is
<aclass="reference internal" href="#matplotlib.mlab.window_hanning" title="matplotlib.mlab.window_hanning"><codeclass="xref py py-func docutils literal"><spanclass="pre">window_hanning()</span></code></a>. If a function is passed as the
argument, it must take a data segment as an argument and
<div><p>Specifies whether the resulting density values should be scaled
by the scaling frequency, which gives density in units of Hz^-1.
This allows for integration over the returned frequency values.
The default is True for MATLAB compatibility.</p>
</div></blockquote>
<p><strong>noverlap</strong> : integer</p>
<blockquote>
<div><p>The number of points of overlap between blocks. The default value
is 0 (no overlap).</p>
</div></blockquote>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The return value is the tuple (<em>Cxy</em>, <em>f</em>), where <em>f</em> are the</p>
<p>frequencies of the coherence vector. For cohere, scaling the</p>
<p>individual densities by the sampling frequency has no effect,</p>
<p><em>preferSpeedOverMemory</em> is an optional bool. Defaults to true. If
False, limits the caching by only making one, rather than two,
complex cache arrays. This is useful if memory becomes critical.
Even when <em>preferSpeedOverMemory</em> is False, <aclass="reference internal" href="#matplotlib.mlab.cohere_pairs" title="matplotlib.mlab.cohere_pairs"><codeclass="xref py py-func docutils literal"><spanclass="pre">cohere_pairs()</span></code></a>
will still give significant performace gains over calling
<aclass="reference internal" href="#matplotlib.mlab.cohere" title="matplotlib.mlab.cohere"><codeclass="xref py py-func docutils literal"><spanclass="pre">cohere()</span></code></a> for each pair, and will use subtantially less
memory than if <em>preferSpeedOverMemory</em> is True. In my tests with
a 43000,64 array over all nonredundant pairs,
<em>preferSpeedOverMemory</em> = True delivered a 33% performance boost
on a 1.7GHZ Athlon with 512MB RAM compared with
<em>preferSpeedOverMemory</em> = False. But both solutions were more
than 10x faster than naively crunching all possible pairs through
<p>For a large number of pairs, <aclass="reference internal" href="#matplotlib.mlab.cohere_pairs" title="matplotlib.mlab.cohere_pairs"><codeclass="xref py py-func docutils literal"><spanclass="pre">cohere_pairs()</span></code></a> can be much more</p>
<p>efficient than just calling <aclass="reference internal" href="#matplotlib.mlab.cohere" title="matplotlib.mlab.cohere"><codeclass="xref py py-func docutils literal"><spanclass="pre">cohere()</span></code></a> for each pair, because</p>
<p>it caches most of the intensive computations. If <imgsrc="../_images/mathmpl/math-1922d1ceaa.png" style="position: relative; bottom: -3px"/> is the</p>
<p>number of pairs, this function is <imgsrc="../_images/mathmpl/math-98c8089378.png" style="position: relative; bottom: -8px"/> for most of the</p>
<p>heavy lifting, whereas calling cohere for each pair is</p>
<p><imgsrc="../_images/mathmpl/math-83ff203e39.png" style="position: relative; bottom: -8px"/>. However, because of the caching, it is also more</p>
<p>memory intensive, making 2 additional complex arrays with</p>
<p>approximately the same number of elements as <em>X</em>.</p>
<p>See <codeclass="file docutils literal"><spanclass="pre">test/cohere_pairs_test.py</span></code> in the src tree for an</p>
<p>example script that shows that this <aclass="reference internal" href="#matplotlib.mlab.cohere_pairs" title="matplotlib.mlab.cohere_pairs"><codeclass="xref py py-func docutils literal"><spanclass="pre">cohere_pairs()</span></code></a> and</p>
<pclass="last"><aclass="reference internal" href="#matplotlib.mlab.cohere" title="matplotlib.mlab.cohere"><codeclass="xref py py-func docutils literal"><spanclass="pre">cohere()</span></code></a> give the same results for a given pair.</p>
<dd>For information about the methods used to compute <imgsrc="../_images/mathmpl/math-0005c3a5e5.png" style="position: relative; bottom: -9px"/>, <imgsrc="../_images/mathmpl/math-f6d65b7f49.png" style="position: relative; bottom: -6px"/> and <imgsrc="../_images/mathmpl/math-0938c51d1a.png" style="position: relative; bottom: -9px"/>.</dd>
</dl>
</div>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.mlab.complex_spectrum">
<codeclass="descclassname">matplotlib.mlab.</code><codeclass="descname">complex_spectrum</code><spanclass="sig-paren">(</span><em>x</em>, <em>Fs=None</em>, <em>window=None</em>, <em>pad_to=None</em>, <em>sides=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.mlab.complex_spectrum" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the complex-valued frequency spectrum of <em>x</em>. Data is padded to a
length of <em>pad_to</em> and the windowing function <em>window</em> is applied to the
<aclass="reference external" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.get_window.html#scipy.signal.get_window" title="(in SciPy v1.0.0)"><codeclass="xref py py-func docutils literal"><spanclass="pre">scipy.signal.get_window()</span></code></a>, etc. The default is
<aclass="reference internal" href="#matplotlib.mlab.window_hanning" title="matplotlib.mlab.window_hanning"><codeclass="xref py py-func docutils literal"><spanclass="pre">window_hanning()</span></code></a>. If a function is passed as the
argument, it must take a data segment as an argument and
<dd><aclass="reference internal" href="#matplotlib.mlab.magnitude_spectrum" title="matplotlib.mlab.magnitude_spectrum"><codeclass="xref py py-func docutils literal"><spanclass="pre">magnitude_spectrum()</span></code></a> returns the absolute value of this function.</dd>