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