v2.0.0
Loading...
Searching...
No Matches
DECODINGLIB::DecodingSsd Class Reference

Spatio-spectral decomposition for narrowband signal enhancement on continuous M/EEG. More...

#include <decoding_ssd.h>

Public Member Functions

 DecodingSsd (int nComponents=6, double regParam=0.05)
void fit (const Eigen::Ref< const Eigen::MatrixXd > &data, double sfreq, double signalLow, double signalHigh, double noiseLow, double noiseHigh)
Eigen::MatrixXd transform (const Eigen::Ref< const Eigen::MatrixXd > &data) const
Eigen::MatrixXd fitTransform (const Eigen::Ref< const Eigen::MatrixXd > &data, double sfreq, double signalLow, double signalHigh, double noiseLow, double noiseHigh)
Eigen::MatrixXd apply (const Eigen::Ref< const Eigen::MatrixXd > &data) const
const Eigen::MatrixXd & filters () const
const Eigen::MatrixXd & patterns () const
const Eigen::VectorXd & eigenvalues () const
bool isFitted () const

Detailed Description

Spatio-spectral decomposition for narrowband signal enhancement on continuous M/EEG.

Computes the spatial filters that jointly maximise variance in the caller-specified signal band and minimise it in the surrounding noise band, returning the n_components leading components ranked by signal-to-noise eigenvalue. The fit takes raw continuous data (channels × samples), bandpasses it twice internally with a zero- phase windowed-sinc FIR, builds the two covariance matrices, shrinks the noise covariance towards a scaled identity by regParam to keep the generalised eigenproblem well-conditioned, and stores the resulting filters, patterns and eigenvalues. The eigenvalues are directly interpretable as the per-component signal-band power gain over the noise band and are the standard diagnostic for choosing the effective rank of the decomposition.

transform returns the components themselves — a low-dimensional signal that already lives in the band of interest — while apply performs the low-rank back-projection \(X_{\text{clean}} = A_{:,1:k} W_{1:k,:} X\) that yields a sensor-space, denoised reconstruction with the oscillation of interest preserved and the broadband background suppressed; this is the call most downstream pipelines (connectivity, inverse modelling) want when SSD is used purely as a preprocessor.

See also
DECODINGLIB, mne.decoding.SSD

Definition at line 88 of file decoding_ssd.h.

Constructor & Destructor Documentation

◆ DecodingSsd()

DecodingSsd::DecodingSsd ( int nComponents = 6,
double regParam = 0.05 )
explicit

Constructs an SSD decoder.

Parameters
[in]nComponentsNumber of SSD components. Default: 6.
[in]regParamRegularisation parameter for noise covariance. Default: 0.05.

Definition at line 64 of file decoding_ssd.cpp.

Member Function Documentation

◆ apply()

MatrixXd DecodingSsd::apply ( const Eigen::Ref< const Eigen::MatrixXd > & data) const

Denoise data by low-rank factorisation.

Reconstructs M/EEG signals from which the dynamics described by the excluded components is subtracted.

Parameters
[in]dataContinuous data (n_channels × n_times).
Returns
Denoised data (n_channels × n_times).

Definition at line 157 of file decoding_ssd.cpp.

◆ eigenvalues()

const VectorXd & DecodingSsd::eigenvalues ( ) const
Returns
Eigenvalues (signal/noise power ratio).

Definition at line 191 of file decoding_ssd.cpp.

◆ filters()

const MatrixXd & DecodingSsd::filters ( ) const
Returns
Spatial filters (n_components × n_channels).

Definition at line 171 of file decoding_ssd.cpp.

◆ fit()

void DecodingSsd::fit ( const Eigen::Ref< const Eigen::MatrixXd > & data,
double sfreq,
double signalLow,
double signalHigh,
double noiseLow,
double noiseHigh )

Fit SSD from continuous data.

Parameters
[in]dataContinuous data (n_channels × n_times).
[in]sfreqSampling frequency in Hz.
[in]signalLowLower edge of signal band (Hz).
[in]signalHighUpper edge of signal band (Hz).
[in]noiseLowLower edge of noise band (Hz).
[in]noiseHighUpper edge of noise band (Hz).

Definition at line 72 of file decoding_ssd.cpp.

◆ fitTransform()

MatrixXd DecodingSsd::fitTransform ( const Eigen::Ref< const Eigen::MatrixXd > & data,
double sfreq,
double signalLow,
double signalHigh,
double noiseLow,
double noiseHigh )

Fit and transform in one step.

Definition at line 146 of file decoding_ssd.cpp.

◆ isFitted()

bool DecodingSsd::isFitted ( ) const
Returns
True if the model has been fitted.

Definition at line 201 of file decoding_ssd.cpp.

◆ patterns()

const MatrixXd & DecodingSsd::patterns ( ) const
Returns
Spatial patterns (n_channels × n_components).

Definition at line 181 of file decoding_ssd.cpp.

◆ transform()

MatrixXd DecodingSsd::transform ( const Eigen::Ref< const Eigen::MatrixXd > & data) const

Apply spatial filters to data.

Parameters
[in]dataContinuous data (n_channels × n_times).
Returns
Filtered data (n_components × n_times).

Definition at line 136 of file decoding_ssd.cpp.


The documentation for this class was generated from the following files: