Skip to main content

XdawnResult

Namespace: RTPROCESSINGLIB  ·  Library: DSP Library

#include <dsp/xdawn.h>

struct UTILSLIB::XdawnResult

Result of an xDAWN decomposition.

src/examples/ex_dsp_preprocessing/main.cpp
const XdawnResult xdawn = Xdawn::fit(epochs, 1, 1); // enhance the response to event code 1
const MatrixXd component = Xdawn::apply(epochs[0].epoch, xdawn);

Example​

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 186
const XdawnResult xdawn = Xdawn::fit(epochs, 1, 1); // enhance the response to event code 1
const MatrixXd component = Xdawn::apply(epochs[0].epoch, xdawn);
const VectorXd pattern = xdawn.matPatterns.col(0) / xdawn.matPatterns.col(0).cwiseAbs().maxCoeff();
ok &= expect(xdawn.bValid && component.rows() == 1 && std::fabs(std::fabs(pattern(1) / pattern(0)) - 0.5) < 0.1 && std::fabs(pattern(2)) < 0.15,
QString("xDAWN pattern ratio ch1/ch0 %1 (0.5), ch2 %2 (0)").arg(pattern(1) / pattern(0)).arg(pattern(2)));

Authors of this file​