@@ -1239,78 +1239,65 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
1239
1239
"""
1240
1240
Compute a spectrogram.
1241
1241
1242
- Call signature::
1243
-
1244
- specgram(x, NFFT=256, Fs=2,detrend=mlab.detrend_none,
1245
- window=mlab.window_hanning, noverlap=128,
1246
- cmap=None, xextent=None, pad_to=None, sides='default',
1247
- scale_by_freq=None, mode='default')
1248
-
1249
- Compute and plot a spectrogram of data in *x*. Data are split into
1250
- *NFFT* length segments and the spectrum of each section is
1251
- computed. The windowing function *window* is applied to each
1242
+ Compute and plot a spectrogram of data in x. Data are split into
1243
+ NFFT length segments and the spectrum of each section is
1244
+ computed. The windowing function window is applied to each
1252
1245
segment, and the amount of overlap of each segment is
1253
- specified with * noverlap* .
1246
+ specified with noverlap.
1254
1247
1255
- *x*: 1-D array or sequence
1256
- Array or sequence containing the data
1248
+ Parameters
1249
+ ----------
1250
+ x : array_like
1251
+ 1-D array or sequence.
1257
1252
1258
1253
%(Spectral)s
1259
1254
1260
1255
%(PSD)s
1261
1256
1262
- *mode*: [ 'default' | 'psd' | 'complex' | 'magnitude'
1263
- 'angle' | 'phase' ]
1264
-
1265
- What sort of spectrum to use. Default is 'psd'. which takes the
1266
- power spectral density. 'complex' returns the complex-valued
1267
- frequency spectrum. 'magnitude' returns the magnitude spectrum.
1268
- 'angle' returns the phase spectrum without unwrapping. 'phase '
1269
- returns the phase spectrum with unwrapping.
1270
-
1271
- *noverlap*: integer
1272
- The number of points of overlap between blocks . The default value
1273
- is 128.
1274
-
1275
- Returns the tuple (* spectrum*, *freqs*, *t*):
1276
-
1277
- *spectrum*: 2-D array
1278
- columns are the periodograms of successive segments
1279
-
1280
- *freqs*: 1-D array
1281
- The frequencies corresponding to the rows in * spectrum*
1257
+ noverlap : int, optional
1258
+ The number of points of overlap between blocks. The default
1259
+ value is 128.
1260
+ mode : str, optional
1261
+ What sort of spectrum to use, default is 'psd'.
1262
+
1263
+ 'psd '
1264
+ Returns the power spectral density.
1265
+
1266
+ 'complex'
1267
+ Returns the complex-valued frequency spectrum .
1268
+
1269
+ 'magnitude'
1270
+ Returns the magnitude spectrum.
1271
+
1272
+ 'angle'
1273
+ Returns the phase spectrum without unwrapping.
1274
+
1275
+ 'phase'
1276
+ Returns the phase spectrum with unwrapping.
1282
1277
1283
- *t*: 1-D array
1284
- The times corresponding to midpoints of segments (i.e the columns
1285
- in *spectrum*).
1286
-
1287
- .. note::
1288
-
1289
- *detrend* and *scale_by_freq* only apply when *mode* is set to
1290
- 'psd'
1291
-
1292
- .. seealso::
1293
-
1294
- :func:`psd`
1295
- :func:`psd` differs in the default overlap; in returning
1296
- the mean of the segment periodograms; and in not returning
1297
- times.
1278
+ Returns
1279
+ -------
1280
+ spectrum: array_like
1281
+ 2-D array, columns are the periodograms of successive segments.
1298
1282
1299
- :func:`complex_spectrum`
1300
- A single spectrum, similar to having a single segment when
1301
- *mode* is 'complex'.
1283
+ freqs: array_like
1284
+ 1-D array, frequencies corresponding to the rows in *spectrum*.
1302
1285
1303
- :func:`magnitude_spectrum`
1304
- A single spectrum, similar to having a single segment when
1305
- *mode* is 'magnitude' .
1286
+ t : array_like
1287
+ 1-D array, the times corresponding to midpoints of segments
1288
+ (i.e the columns in *spectrum*) .
1306
1289
1307
- :func:`angle_spectrum`
1308
- A single spectrum, similar to having a single segment when
1309
- *mode* is 'angle'.
1290
+ See Also
1291
+ --------
1292
+ psd : differs in the default overlap; in returning the mean of the segment periodograms; and in not returning times.
1293
+ complex_spectrum : A single spectrum, similar to having a single segment when mode is 'complex'.
1294
+ magnitude_spectrum : A single spectrum, similar to having a single segment when mode is 'magnitude'.
1295
+ angle_spectrum : A single spectrum, similar to having a single segment when mode is 'angle'.
1296
+ phase_spectrum : A single spectrum, similar to having a single segment when mode is 'phase'.
1310
1297
1311
- :func:`phase_spectrum`
1312
- A single spectrum, similar to having a single segment when
1313
- *mode* is 'phase '.
1298
+ Notes
1299
+ -----
1300
+ detrend and scale_by_freq only apply when *mode* is set to 'psd '.
1314
1301
"""
1315
1302
if noverlap is None :
1316
1303
noverlap = 128
0 commit comments