SpectrumEstimate.spectrum#

SpectrumEstimate.spectrum(name)[source]#

One series’ estimated power spectrum, the real diagonal of the density.

Parameters:

name (str) – The series label.

Return type:

NDArray[double]

Returns:

(n,) non-negative power, normalized so that twice its integral over [0, pi] is the series’ variance.

Raises:

SpecificationError – If the label is unknown.

Example

White noise of unit variance has the flat spectrum \(1 / 2\pi\):

>>> rng = np.random.default_rng(0)
>>> est = MultitaperSpectrum(rng.standard_normal(2048)).compute()
>>> round(float(2.0 * np.pi * est.spectrum("y").mean()), 1)
1.0