MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _single_spectrum_helper

Function _single_spectrum_helper

lib/matplotlib/mlab.py:394–417  ·  view source on GitHub ↗

Private helper implementing the commonality between the complex, magnitude, angle, and phase spectrums.

(
        mode, x, Fs=None, window=None, pad_to=None, sides=None)

Source from the content-addressed store, hash-verified

392
393
394def _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

Callers

nothing calls this directly

Calls 1

_spectral_helperFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…