WelchSpectrum.compute#
- WelchSpectrum.compute()[source]#
Estimate the density matrix.
Walks the sample in steps of half a segment, demeans and Hann-tapers each block, and averages the blocks’ cross-periodograms on the segment’s Fourier grid.
- Return type:
- Returns:
The
SpectrumEstimateonsegment // 2 + 1frequencies, withdegrees_of_freedom = 36 B / 19for theBsegments used andbandwidth = 2 pi / segment.
Example
>>> rng = np.random.default_rng(0) >>> est = WelchSpectrum(rng.standard_normal((512, 2)), segment=64).compute() >>> est.method, est.frequencies.shape, round(est.degrees_of_freedom, 1) ('welch', (33,), 28.4)