TESA user manual
  • Introduction
  • Installation, getting started, and reporting bugs
    • A quick intro to TESA
    • A quick intro to Matlab
    • A quick intro to EEGLAB
    • Reporting bugs
  • Overview of TMS-EEG analysis
  • Find and mark TMS pulses
    • Find TMS pulses
    • Find TMS pulses (alternative)
    • Fix TMS pulse latencies
  • Remove and interpolate TMS pulse artifacts
    • Remove TMS pulse artifact
    • Interpolate removed data
  • Remove TMS-evoked muscle activity and other artifacts
    • FastICA
    • Component classification (TESA)
    • Plot and remove components
    • Enhanced deflation method (EDM)
    • PCA compression
    • PCA suppression
    • Detrend
    • SSP–SIR
    • SOUND
  • Filter data
    • Butterworth filter
    • Median filter
  • Analyse TMS-evoked potentials
    • Extract TEPs
    • Find and analyse TEP peaks
    • Output peak analysis
    • Output peak analysis (group)
  • Plot TMS-evoked potentials
    • Plot data
    • Plot data (group)
  • Example analysis pipelines
  • TESA functions under development
Powered by GitBook
On this page
  • EEGLAB user interface
  • Scripts
  • Base function
  • Pop function
  • Required inputs
  • Outputs
  • Examples

Was this helpful?

  1. Remove TMS-evoked muscle activity and other artifacts

Detrend

PreviousPCA suppressionNextSSP–SIR

Last updated 5 years ago

Was this helpful?

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.

EEGLAB user interface

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).

Scripts

Base function

EEG = tesa_detrend( EEG, detrend, timeWin ); Default use.

Pop function

EEG = pop_tesa_detrend( EEG ); Pop up window.

EEG = pop_tesa_detrend( EEG, detrend, timeWin ); Custom inputs.

Required 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]

-

Outputs

Output

Description

EEG

EEGLAB EEG structure

Examples

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.