[FieldTrip] Redoing Brain Vision Analyzer in Field Trip

Andreas Widmann widmann at uni-leipzig.de
Thu Nov 13 16:44:28 CET 2014


Hi,

besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail:
http://www.ncbi.nlm.nih.gov/pubmed/25128257

Hope this helps,
Andreas

> Am 13.11.2014 um 10:07 schrieb Gerome Manson <gerome.manson at utoronto.ca>:
> 
> Hello All, 
> 
> I would like some help to  replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-)
> 
> 
> Thanks alot,
> Gerome
> 
> Here is the brain vision sequence I am trying to replicate
>   - Read in Data
>  - Reference to mastiod
>  - 100Hz Band rejection filter - bandwidth 8, slope 2
>  - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct)
>  - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct)
>  - Notch Filter at 50Hz
>  - Segmentation
>  - Baseline Correction -200 ms to - 5 ms
>  - Averaging segments
> 
> 
> 
> Here is my Field trip code: 
> 
> %rereference all trials
> cfg.reref = 'yes';
> cfg.continuous = 'yes';
> 
> % reference what channels
> cfg.channel = 'all';
> %choose the reference channel
> cfg.refchannel = {'EXG1' 'EXG2'};
> 
> % cfg.dataset = 'CVP1S1.bdf';
> cfg.continuous = 'yes';
> %
> 
> %bandfilter
> cfg.bsfilter = 'yes';
> cfg.bsfiltord = 2;
> % cfg.bsfiltdir = 'onepass-zerophase';
> cfg.bsfreq = [92 108];
> 
> 
> % 
> %DFT
> cfg.dftfilter = 'yes';
> 
> % IIR Filters
> cfg.lpfilter = 'yes';
> cfg.lpfilttype  = 'but';
> % cfg.lpfiltdir = 'onepass-zerophase';
> cfg.lpfreq  = 45;
> 
> cfg.hpfilter = 'yes';
> cfg.hpfilttype  = 'but';
> % cfg.hpfiltdir = 'onepass-zerophase';
> cfg.hpfreq  = 0.53;
> 
> data = ft_preprocessing(cfg);
> 
> 
> % Define Trial
> cfg = [];
> cfg.trialdef.eventtype  = 'STATUS';
> cfg.dataset = eeg_file;
> cfg.trialdef.eventvalue = 65522;
> cfg.trialdef.prestim    = 0.2;
> cfg.trialdef.poststim   = 0.3;
> cfg = ft_definetrial(cfg);
> 
> data_vep = ft_redefinetrial(cfg, data);
> 
> % Baseline Correction
> cfg = [];
> cfg.demean = 'yes';
> cfg.baselinewindow = [-0.2 -0.05];
> data_vep = ft_preprocessing(cfg, data_vep);
> 
> %Averaging
> cfg=[];
> avg_data = ft_timelockanalysis(cfg, data_vep);
> 
> 
> cfg.ylim = [-10 10];
> cfg.channel = 'O1';
> 
> ft_singleplotER(cfg,avg_data);
> 
> -- 
> _____________________
> Gerome Manson PhD Student
> Laboratoire de Neuroscience Cognitives- Aix Marseille Université
> Perceptual Motor Behavior lab- University of Toronto
> gerome.manson at utoronto.ca
> gerome.manson at univ-amu.fr
> 416-978-6109
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip





More information about the fieldtrip mailing list