Note that this reference documentation is identical to the help that is displayed in Matlab when you type “help ft_preprocessing”.
FT_PREPROCESSING reads MEG and/or EEG data according to user-specified trials
and applies several user-specified preprocessing steps to the signals.
Use as
[data] = ft_preprocessing(cfg)
or
[data] = ft_preprocessing(cfg, data)
The first input argument "cfg" is the configuration structure, which
contains all details for the dataset filenames, trials and the
preprocessing options. You can only do preprocessing after defining the
segments of data to be read from the file (i.e. the trials), which is for
example done based on the occurence of a trigger in the data.
If you are calling FT_PREPROCESSING with only the configuration as first
input argument and the data still has to be read from file, you should
specify
cfg.dataset = string with the filename
cfg.trl = Nx3 matrix with the trial definition, see FT_DEFINETRIAL
cfg.padding = length to which the trials are padded for filtering (default = 0)
cfg.continuous = 'yes' or 'no' whether the file contains continuous data
(default is determined automatic)
Instead of specifying the dataset, you can also explicitely specify the
name of the file containing the header information and the name of the
file containing the data, using
cfg.datafile = string with the filename
cfg.headerfile = string with the filename
If you are calling FT_PREPROCESSING with also the second input argument
"data", then that should contain data that was already read from file in
a previous call to FT_PREPROCESSING. In that case only the configuration
options below apply.
The channels that will be read and/or preprocessed are specified with
cfg.channel = Nx1 cell-array with selection of channels (default = 'all'),
see FT_CHANNELSELECTION for details
The preprocessing options for the selected channels are specified with
cfg.lpfilter = 'no' or 'yes' lowpass filter (default = 'no')
cfg.hpfilter = 'no' or 'yes' highpass filter (default = 'no')
cfg.bpfilter = 'no' or 'yes' bandpass filter (default = 'no')
cfg.bsfilter = 'no' or 'yes' bandstop filter (default = 'no')
cfg.dftfilter = 'no' or 'yes' line noise removal using discrete fourier transform (default = 'no')
cfg.medianfilter = 'no' or 'yes' jump preserving median filter (default = 'no')
cfg.lpfreq = lowpass frequency in Hz
cfg.hpfreq = highpass frequency in Hz
cfg.bpfreq = bandpass frequency range, specified as [low high] in Hz
cfg.bsfreq = bandstop frequency range, specified as [low high] in Hz
cfg.dftfreq = line noise frequencies in Hz for DFT filter (default = [50 100 150])
cfg.lpfiltord = lowpass filter order (default = 6)
cfg.hpfiltord = highpass filter order (default = 6)
cfg.bpfiltord = bandpass filter order (default = 4)
cfg.bsfiltord = bandstop filter order (default = 4)
cfg.lpfilttype = digital filter type, 'but' or 'fir' (default = 'but')
cfg.hpfilttype = digital filter type, 'but' or 'fir' (default = 'but')
cfg.bpfilttype = digital filter type, 'but' or 'fir' (default = 'but')
cfg.bsfilttype = digital filter type, 'but' or 'fir' (default = 'but')
cfg.lpfiltdir = filter direction, 'twopass', 'onepass' or 'onepass-reverse' (default = 'twopass')
cfg.hpfiltdir = filter direction, 'twopass', 'onepass' or 'onepass-reverse' (default = 'twopass')
cfg.bpfiltdir = filter direction, 'twopass', 'onepass' or 'onepass-reverse' (default = 'twopass')
cfg.bsfiltdir = filter direction, 'twopass', 'onepass' or 'onepass-reverse' (default = 'twopass')
cfg.medianfiltord = length of median filter (default = 9)
cfg.blc = 'no' or 'yes', whether to apply baseline correction (default = 'no')
cfg.blcwindow = [begin end] in seconds, the default is the complete trial (default = 'all')
cfg.detrend = 'no' or 'yes', this is done on the complete trial (default = 'no')
cfg.polyremoval = 'no' or 'yes', this is done on the complete trial (default = 'no')
cfg.polyorder = polynome order (default = 2)
cfg.derivative = 'no' or 'yes', computes the first order derivative of the data (default = 'no')
cfg.hilbert = 'no', 'abs', 'complex', 'real', 'imag', 'absreal', 'absimag' or 'angle' (default = 'no')
cfg.rectify = 'no' or 'yes' (default = 'no')
cfg.precision = 'single' or 'double' (default = 'double')
Preprocessing options that you should only use for EEG data are
cfg.reref = 'no' or 'yes' (default = 'no')
cfg.refchannel = cell-array with new EEG reference channel(s)
cfg.implicitref = 'label' or empty, add the implicit EEG reference as zeros (default = [])
cfg.montage = 'no' or a montage structure (default = 'no')
Preprocessing options that you should only use when you are calling FT_PREPROCESSING with
also the second input argument "data" are
cfg.trials = 'all' or a selection given as a 1xN vector (default = 'all')
Preprocessing options that you should only use when you are calling
FT_PREPROCESSING with a single cfg input argument are
cfg.method = 'trial' or 'channel', read data per trial or per channel (default = 'trial')
See also FT_DEFINETRIAL, FT_REDEFINETRIAL, FT_APPENDDATA, FT_APPENDSPIKE