Detrend
Last updated
Last updated
This function detrends the data by fitting and subtracting a function from each channel. Either a linear (fitted and subtracted from each trial), exponential or double exponential function (fitted to average and subtracted from each trial) can be fitted.
Note that the Curve Fitting Toolbox is required to run either the exponential or the double exponential fit.
1. Select the type of function that will be fitted to the data: either linear, exponential or double (i.e. double exponential).
2. Enter the time range over which the detrend will be fitted and applied (in ms).
EEG = tesa_detrend( EEG, detrend, timeWin );
Default use.
EEG = pop_tesa_detrend( EEG );
Pop up window.
EEG = pop_tesa_detrend( EEG, detrend, timeWin );
Custom inputs.
Input
Description
Example
Default
EEG
EEGLAB EEG structure
EEG
-
detrend
String with type of detrend to perform; 'linear' or 'exponetial' or 'double'
'linear'
-
timeWin
Vector setting time window for detrending in ms. [start, end]
[11,500]
-
Output
Description
EEG
EEGLAB EEG structure
EEG = pop_tesa_detrend( EEG, 'linear', [11,500]);
Linear detrend.
EEG = pop_tesa_detrend( EEG, 'exponential', [11,500]);
Exponential detrend.
EEG = pop_tesa_detrend( EEG, 'double', [11,500]);
Double exponential detrend.