Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix noverlap kwarg documentation for the PSD-related functions. Fix s…

…pecgram return information. Fixes #840.
  • Loading branch information...
commit e912826262cf5e4e7feb1e60f897384555a5e025 1 parent c0ee100
@mdboom mdboom authored
Showing with 33 additions and 5 deletions.
  1. +17 −1 lib/matplotlib/axes.py
  2. +16 −4 lib/matplotlib/mlab.py
View
18 lib/matplotlib/axes.py
@@ -8218,6 +8218,10 @@ def psd(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The default value
+ is 0 (no overlap).
+
*Fc*: integer
The center frequency of *x* (defaults to 0), which offsets
the x extents of the plot to reflect the frequency range used
@@ -8295,6 +8299,10 @@ def csd(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The
+ default value is 0 (no overlap).
+
*Fc*: integer
The center frequency of *x* (defaults to 0), which offsets
the x extents of the plot to reflect the frequency range used
@@ -8361,6 +8369,10 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The
+ default value is 0 (no overlap).
+
*Fc*: integer
The center frequency of *x* (defaults to 0), which offsets
the x extents of the plot to reflect the frequency range used
@@ -8421,6 +8433,10 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The
+ default value is 128.
+
*Fc*: integer
The center frequency of *x* (defaults to 0), which offsets
the y extents of the plot to reflect the frequency range used
@@ -8445,7 +8461,7 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
- *bins* are the time points the spectrogram is calculated over
- *freqs* is an array of frequencies
- - *Pxx* is a len(times) x len(freqs) array of power
+ - *Pxx* is an array of shape `(len(times), len(freqs))` of power
- *im* is a :class:`~matplotlib.image.AxesImage` instance
Note: If *x* is real (i.e. non-complex), only the positive
View
20 lib/matplotlib/mlab.py
@@ -332,10 +332,6 @@ def _spectral_helper(x, y, NFFT=256, Fs=2, detrend=detrend_none,
argument, it must take a data segment as an argument and
return the windowed version of the segment.
- *noverlap*: integer
- The number of points of overlap between blocks. The default value
- is 0 (no overlap).
-
*pad_to*: integer
The number of points to which the data segment is padded when
performing the FFT. This can be different from *NFFT*, which
@@ -377,6 +373,10 @@ def psd(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The default value
+ is 0 (no overlap).
+
Returns the tuple (*Pxx*, *freqs*).
Refs:
@@ -409,6 +409,10 @@ def csd(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The default value
+ is 0 (no overlap).
+
Returns the tuple (*Pxy*, *freqs*).
Refs:
@@ -437,6 +441,10 @@ def specgram(x, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The default value
+ is 128.
+
Returns a tuple (*Pxx*, *freqs*, *t*):
- *Pxx*: 2-D array, columns are the periodograms of
@@ -482,6 +490,10 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
%(PSD)s
+ *noverlap*: integer
+ The number of points of overlap between blocks. The default value
+ is 0 (no overlap).
+
The return value is the tuple (*Cxy*, *f*), where *f* are the
frequencies of the coherence vector. For cohere, scaling the
individual densities by the sampling frequency has no effect,
Please sign in to comment.
Something went wrong with that request. Please try again.