spd_learn.functional.cross_covariance#

spd_learn.functional.cross_covariance(X: Tensor) → Tensor[source]#

Computes the real-valued cross-frequency covariance matrix.

This function computes the covariance matrix across both frequency bands and channels for wavelet-transformed EEG signals. The frequency and channel dimensions are flattened into a single feature dimension before computing the covariance.

Parameters:

X (torch.Tensor) – Input tensor of shape (…, F, C, T), where F is the number of frequency bands, C is the number of channels, and T is the number of time samples.

Returns:

The real part of the cross-frequency covariance matrix, with shape (…, F * C, F * C).

Return type:

torch.Tensor