IcaResult
Namespace: RTPROCESSINGLIB · Library: DSP Library
#include <dsp/ica.h>
struct UTILSLIB::IcaResult
Result of an ICA decomposition.
Holds the mixing and unmixing matrices and the extracted source time series. The relationship is: sources = unmixing * (data - mean) data_recon = mixing * sources + mean
src/examples/ex_dsp_preprocessing/main.cpp
const IcaResult ica = ICA::run(mixed, 3); // FastICA, logcosh, fixed seed
const MatrixXd cleaned = ICA::excludeComponents(mixed, ica, {0}); // drop component 0, back-project the rest
Example
- Full source:
src/examples/ex_dsp_preprocessing/main.cpp - Build target:
ex_dsp_preprocessing(runs under CTest)
Used in examples
ex_dsp_preprocessing
Preprocessing tools of the dsp library on synthetic data with a known ground truth.
src/examples/ex_dsp_preprocessing/main.cpp, line 122
const IcaResult ica = ICA::run(mixed, 3); // FastICA, logcosh, fixed seed
const MatrixXd cleaned = ICA::excludeComponents(mixed, ica, {0}); // drop component 0, back-project the rest
ok &= expect(worstRecovery(ica.matSources, sources) > 0.99, QString("FastICA recovers all sources (worst |r| %1)").arg(worstRecovery(ica.matSources, sources)));
ok &= expect((mixed - cleaned - ica.matMixing.col(0) * ica.matSources.row(0)).cwiseAbs().maxCoeff() < 1e-9,
"excluding a component removes exactly its back-projection");
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>