Private helper implementing the commonality between the complex, magnitude, angle, and phase spectrums.
(
mode, x, Fs=None, window=None, pad_to=None, sides=None)
| 392 | |
| 393 | |
| 394 | def _single_spectrum_helper( |
| 395 | mode, x, Fs=None, window=None, pad_to=None, sides=None): |
| 396 | """ |
| 397 | Private helper implementing the commonality between the complex, magnitude, |
| 398 | angle, and phase spectrums. |
| 399 | """ |
| 400 | _api.check_in_list(['complex', 'magnitude', 'angle', 'phase'], mode=mode) |
| 401 | |
| 402 | if pad_to is None: |
| 403 | pad_to = len(x) |
| 404 | |
| 405 | spec, freqs, _ = _spectral_helper(x=x, y=None, NFFT=len(x), Fs=Fs, |
| 406 | detrend_func=detrend_none, window=window, |
| 407 | noverlap=0, pad_to=pad_to, |
| 408 | sides=sides, |
| 409 | scale_by_freq=False, |
| 410 | mode=mode) |
| 411 | if mode != 'complex': |
| 412 | spec = spec.real |
| 413 | |
| 414 | if spec.ndim == 2 and spec.shape[1] == 1: |
| 415 | spec = spec[:, 0] |
| 416 | |
| 417 | return spec, freqs |
| 418 | |
| 419 | |
| 420 | # Split out these keyword docs so that they can be used elsewhere |
nothing calls this directly
no test coverage detected
searching dependent graphs…