cogpy.spectral.specx

Spectral transforms with xarray interface.

This module wraps core spectral functions from cogpy.spectral (psd.py, multitaper.py, bivariate.py) to work seamlessly with xarray.DataArray, preserving coordinates, dimensions, and metadata.

Convention

  • Input: xr.DataArray with a time dimension

  • Output: xr.DataArray with a freq dimension (or freq``×``time for spectrograms)

  • Preserves all non-time dimensions and coordinates that do not depend on time

  • Uses SciPy/NumPy/Ghostipy backends via cogpy.spectral

Status

STATUS: ACTIVE Reason: xarray interface for spectral analysis to match filtering.py pattern Superseded by: n/a Safe to remove: no

Functions

coherencex(sigx, sigy, *[, axis, NW, nfft, ...])

Multitaper magnitude squared coherence between two signals.

normalize_spectrogram(spec, *[, method, dim])

Normalize a spectrogram along a dimension.

psdx(sigx, *[, axis, method, bandwidth, ...])

Power spectral density with xarray interface.

spectrogramx(sigx, *[, axis, bandwidth, ...])

Multitaper spectrogram (time-frequency representation).