@@ -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*):
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
+ 'psd'
1263
+ Returns the power spectral density.
1276
1264
1277
- *spectrum*: 2-D array
1278
- columns are the periodograms of successive segments
1265
+ 'complex'
1266
+ Returns the complex-valued frequency spectrum.
1279
1267
1280
- *freqs*: 1-D array
1281
- The frequencies corresponding to the rows in *spectrum*
1282
-
1283
- *t*: 1-D array
1284
- The times corresponding to midpoints of segments (i.e the columns
1285
- in *spectrum*).
1268
+ 'magnitude'
1269
+ Returns the magnitude spectrum.
1286
1270
1287
- .. note::
1271
+ 'angle'
1272
+ Returns the phase spectrum without unwrapping.
1288
1273
1289
- *detrend* and *scale_by_freq* only apply when *mode* is set to
1290
- 'psd'
1274
+ 'phase'
1275
+ Returns the phase spectrum with unwrapping.
1291
1276
1292
- .. seealso::
1277
+ Returns
1278
+ -------
1279
+ spectrum : array_like
1280
+ 2-D array, columns are the periodograms of successive segments.
1293
1281
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.
1282
+ freqs : array_like
1283
+ 1-D array, frequencies corresponding to the rows in *spectrum*.
1298
1284
1299
- :func:`complex_spectrum`
1300
- A single spectrum, similar to having a single segment when
1301
- *mode* is 'complex' .
1285
+ t : array_like
1286
+ 1-D array, the times corresponding to midpoints of segments
1287
+ (i.e the columns in *spectrum*) .
1302
1288
1303
- :func:`magnitude_spectrum`
1304
- A single spectrum, similar to having a single segment when
1305
- *mode* is 'magnitude'.
1289
+ See Also
1290
+ --------
1291
+ psd : differs in the overlap and in the return values.
1292
+ complex_spectrum : similar, but with complex valued frequencies.
1293
+ magnitude_spectrum : similar single segment when mode is 'magnitude'.
1294
+ angle_spectrum : similar to single segment when mode is 'angle'.
1295
+ phase_spectrum : similar to single segment when mode is 'phase'.
1306
1296
1307
- :func:`angle_spectrum`
1308
- A single spectrum, similar to having a single segment when
1309
- *mode* is 'angle '.
1297
+ Notes
1298
+ -----
1299
+ detrend and scale_by_freq only apply when *mode* is set to 'psd '.
1310
1300
1311
- :func:`phase_spectrum`
1312
- A single spectrum, similar to having a single segment when
1313
- *mode* is 'phase'.
1314
1301
"""
1315
1302
if noverlap is None :
1316
1303
noverlap = 128
0 commit comments