#include "warping.h"
#include "optarg.h"
#include "array.h"
#include "linalg.h"
#include "eeg.h"
#include <math.h>
Go to the source code of this file.
Functions | |
Array * | dtw_add_signals (const Array *s1, const Array *s2, const Array *path, OptArgList *opts) |
Add signals according to a warppath. | |
WarpPath * | dtw_backtrack (const double **d, int M, int N, WarpPath *P) |
void | dtw_cumulate_matrix (double **d, int M, int N, OptArgList *optargs) |
EEG * | eeg_gibbons (EEG *eeg, int stimulus_marker, int response_marker, double k) |
void | free_warppath (WarpPath *p) |
WarpPath * | init_warppath (WarpPath *path, int n1, int n2) |
Array * | matrix_dtw_backtrack (const Array *d) |
calculate the warping path. | |
Array * | matrix_dtw_cumulate (Array *mat, bool alloc, OptArgList *optargs) |
cumulate a distance matrix d for Dynamic Time-Warping. | |
void | print_warppath (FILE *out, WarpPath *P) |
void | reset_warppath (WarpPath *P, int n1, int n2) |
void dtw_cumulate_matrix | ( | double ** | d, | |
int | M, | |||
int | N, | |||
OptArgList * | optargs | |||
) |
Warp-average according to Gibbons+Stahl 2007. They proposed to stretch or compress the single signals in order to match the average reaction time, by simply moving the sampling points in time according to a linear, quadratic, cubic or to-the-power-of-four function. Formally, they adjusted the time-axis by letting
where denotes the reaction time of the current trial and E is the expected value (the mean reaction time across trials). In their work, Gibbons et al. studied this approach for
.
Individual trials are warped according to and also the averages obtained from different individuals. Warping takes place between stimulus-onset-marker and response-marker
eeg_in | input | |
stmulus_marker | gives the index indicating which of the markers within eeg_in is the stimulus-onset | |
response_marker | gives the index indicating which of the markers within eeg_in is the response-onset | |
k | parameter for gibbon's method |