[FieldTrip] Beamforming / ft_sourceplot

Brilliant.OE8891 at mh-hannover.de Brilliant.OE8891 at mh-hannover.de
Fri Sep 2 16:58:47 CEST 2022

Hallo Jan-Mathijs,

Thank you very much for your reply!

Regarding point 1) The number of epochs pre/post more or less matched and 2) for each groups there are around 2000 epochs, which I think plenty enough.

However, I realized, that your point 3) and 4) do make sense, that 200 ms is too short to estimate 5 Hz.
And 5) I used different ft_freqnanalysis method, ‘wavelet’ frequency analysis for the Topoplot, and ‘mtmfft’ for the Beamformer.
6) And I need to check again about the outliers.

So, I have some points to correct and hopefully find the reason of this difference.

Thanks and kindest regards,


Von: fieldtrip [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Schoffelen, J.M. (Jan Mathijs) via fieldtrip
Gesendet: Freitag, 26. August 2022 13:09
An: FieldTrip discussion list <fieldtrip at science.ru.nl>
Cc: Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl>
Betreff: Re: [FieldTrip] Beamforming / ft_sourceplot

Hi Brilliant,

It’s hard to give a sensible answer here, but I would inspect at least the following aspects:

1) are the number of epochs pre/post more or less matched, and if not are they systematically different across groups?
2) how many epochs were there to begin with? If too few, the quality of the cross-spectral density may be insufficient to get a good spatial filter
3) does it really make sense to estimate a 5 Hz ‘oscillation’ using only 200 milliseconds of data?
4) does it really make sense on top of 3) to have a smoothing bandwith of 3.5 Hz? -> probably this is of no consequence because the intrinsic frequency resolution of 200 ms of data is 5 Hz to begin with.
5) were the channel topo’s obtained with the same analytic steps? Note: if you did for instance ft_freqanalysis with ‘mtmconvol’ in the method, and a t_ftimwin of >200 you have an intrinsically higher frequency resolution to begin with, which might lead to drastically different results.
6) have you inspected the individual subjects to see whether there are any outliers in any one of them?

Good luck hunting for any hints to explain the discrepancies,

On 24 Aug 2022, at 16:00, Brilliant via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Fieldtrip Community,

my name is Brilliant.
I am continuing my Time-Frequency Analysis on EEG-Data and am trying to compute the Source Reconstruction with the Beamforming in Fieldtrip.
The EEG-Data I used were collected in experiments, which the participants listened to auditory stimuli and had to respond by pressing one of the two buttons, depending on which stimulus they heard.

Two groups performed this same tasks and the grand-mean results of both groups show a synchronization compared to the baseline in delta-theta region (1-8 Hz) at around 0.4 seconds after the stimulus onset. The Topographic-Map confirmed these activations (see. Figure A. Top). However, the result from the Beamforming shows desynchronization in Group2, which doesn’t fit the Topographic-Map and Grand-Mean results (see. Figure A. Bottom). We are not sure where the mistake was. We thought it had something to do with the baseline, but without baseline-contrast, the beamforming result only show activity in central region for all tasks/frequency bands.

I attached the code I use below this mail and appreciate any feedbacks and suggestions.

Thank you and kindest regards,



Brilliant, M.Sc.
Pronouns: he, him, his

Medizinische Hochschule Hannover
Institut für AudioNeuroTechnologie (VIANNA)
OE 8891, M20, Ebene 01, Raum 1640
Stadtfelddamm 34
30625 Hannover

Tel.: +49 511 532-1532 (EEG-Labor)
Email: brilliant.OE8891 at mh-hannover.de<mailto:brilliant.OE8891 at mh-hannover.de>
Web: www.neuroprostheses.com<https://urldefense.com/v3/__http:/www.neuroprostheses.com/__;!!HJOPV4FYYWzcc1jazlU!4ZS-wwZ3med6IJjlP0P-_NLOUpglyZkqYZayhA8C-wWXnvqxgeHSCe26fparcSQTpbyPtLwL4msBWYm_Rejbyagmns5qPrDWMwwtjA$>


freqBand        = 'DeltaTheta';
baselineStart   = -0.2;
baselineEnd     = -0.4;
timeStart       = 0.2;
timeEnd         = 0.4;
freqStart       = 1;
freqEnd         = 8;
% Separating Data (pre: Baseline-, post: Activation-period)
cfg = [];
cfg.toilim        = [baselineEnd baselineStart];
dataft_pre        = ft_redefinetrial(cfg, dataft_aktuell);
cfg = [];
cfg.toilim        = [timeStart timeEnd];
dataft_post       = ft_redefinetrial(cfg, dataft_aktuell);
% One Middle Freuency and Multiple Taper
freqMid           = (freqEnd + freqStart)/2;
choosenFreq       = ceil(freqMid);
choosenFreqLim    = [choosenFreq choosenFreq];
taper             = freqEnd - freqMid;
% Time-frequency calculation of Baseline- and Activation-period
cfg = [];
cfg.method        = 'mtmfft';
cfg.output        = 'powandcsd';
cfg.taper         = 'dpss';
cfg.keeptrials    = 'yes';
cfg.tapsmofrq     = taper;
cfg.foilim        = choosenFreqLim;
TFR_pre           = ft_freqanalysis(cfg, dataft_pre);
cfg = [];
cfg.method        = 'mtmfft';
cfg.output        = 'powandcsd';
cfg.taper         = 'dpss';
cfg.keeptrials    = 'yes';
cfg.tapsmofrq     = taper;
cfg.foilim        = choosenFreqLim;
TFR_post          = ft_freqanalysis(cfg, dataft_post);
% Calculating common filter
dataft_prepost = ft_appenddata([], dataft_pre, dataft_post);
cfg = [];
cfg.method        = 'mtmfft';
cfg.output        = 'powandcsd';
cfg.taper         = 'dpss';
cfg.keeptrials    = 'yes';
cfg.tapsmofrq     = taper;
cfg.foilim        = choosenFreqLim;
TFR_prepost       = ft_freqanalysis(cfg, dataft_prepost);
cfg                     = [];
cfg.method             = 'dics';
cfg.frequency          = choosenFreqLim;
cfg.sourcemodel        = leadfield;
cfg.headmodel          = headmodel;
cfg.senstype           = 'EEG';
cfg.dics.projectnoise  = 'yes';
cfg.dics.lambda        = lambda;
cfg.dics.keepfilter    = 'yes';
cfg.dics.realfilter    = 'yes';
source_prepost          = ft_sourceanalysis(cfg, TFR_prepost);
% Source calculation
cfg                     = [];
cfg.method              = 'dics';
cfg.frequency           = choosenFreqLim;
cfg.sourcemodel         = leadfield;
cfg.headmodel           = headmodel;
cfg.senstype            = 'EEG';
cfg.dics.projectnoise   = 'yes';
lambda = '10%';         % Defining Lambda
cfg.dics.lambda         = lambda;
cfg.dics.keepfilter     = 'yes';
cfg.dics.realfilter     = 'yes';

cfg.sourcemodel.filter  = source_prepost.avg.filter;
source_pre_mcon         = ft_sourceanalysis(cfg, TFR_pre);
source_post_mcon        = ft_sourceanalysis(cfg, TFR_post);
source_diff             = source_post_mcon;
source_diff.avg.pow     = (source_post_mcon.avg.pow - source_pre_mcon.avg.pow) ./ source_pre_mcon.avg.pow;
fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220902/398235eb/attachment.htm>

More information about the fieldtrip mailing list