[FieldTrip] Time frequency analysis using evoked potentials

Herring, J.D. (Jim) J.Herring at donders.ru.nl
Thu Aug 3 14:44:38 CEST 2017


Hi Alex,

If this is the code you used:

cfg = [];
cfg.output       = 'pow';
cfg.channel      = 'Cz';
cfg.method       = 'mtmconvol';
cfg.taper        = 'hanning';
cfg.foi          = 1:0.025:30;  % OR 4:0.025:30
cfg.t_ftimwin    = 3./cfg.foi;
cfg.toi          = -0.5:0.01:0.7;
TFRwave = ft_freqanalysis(cfg, trialdata);


There shouldn’t be a difference in the values from 4 - 30 Hz, whether, or not you calculate 1-4 Hz as well. The NaN values for the lower frequencies at the edges (and for very low frequencies for the entire time course) can be explained by the fact that your epochs from -1s to +1.2 are not long enough to fit even a single time window you are requesting. For example, in cfg.t_ftimwin you are requesting a moving time window of 3 cycles. At 1 Hz (=oscillation with period of 1 second), you are requesting a 3 second moving time window. As your data is shorter than 3 seconds, you will not be able to estimate power at any of the requested time points in cfg.toi. With an epoch length of 2.2 seconds you will only start to get estimates from ~1.4 Hz ( cycles/epoch length ) onwards.

Best,

Jim
On 1 Aug 2017, at 13:28, Alexander Mentink <amentink at chdr.nl<mailto:amentink at chdr.nl>> wrote:

Thanks Jim,

The graphs look a bit better, however I still get many NaN artifacts when I want to show the frequency range of 1-30 Hz, which disappears completely when I shift it to 4-30 Hz.

Does anyone know what the underlying problem is here?

KR,

Alex





Alexander Mentink
Centre for Human Drug Research
Zernikedreef 8
2333 CL Leiden
The Netherlands
T +31 (0) 71 7517166
amentink at chdr.nl<mailto:amentink at chdr.nl>
http://www.chdr.nl<http://www.chdr.nl/>

Follow us:
<image514dfb.PNG><http://www.twitter.com/chdr_nl>       <image819e4b.PNG><http://www.linkedin.com/company/centre-for-human-drug-research>




________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Herring, J.D. (Jim) <J.Herring at donders.ru.nl<mailto:J.Herring at donders.ru.nl>>
Sent: 01 August 2017 13:05
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Time frequency analysis using evoked potentials

Dear Alex,

Change your scaling to ‘maxabs’ (cfg.zlim = ‘maxabs’;) to get a better feel of the scaling of your data. Now you have a scaling from 0 to 1, which, given your data, gives you very saturated images.

Also, I would argue using a relative baseline on a TFR of an ERP (or ERF) is risky as in theory, your baseline should be zero (you even explicitly try to impose that by performing a baseline correction when calculating the ERP). This means that you are dividing your activation period by values close to zero. This will give you arbitrarily large values. An absolute baseline is preferred.

Best,

Jim


On 1 Aug 2017, at 11:52, Alexander Mentink <amentink at chdr.nl<mailto:amentink at chdr.nl>> wrote:

Hi Fieldtrip community,

I am trying to analyse time frequency representations of electrical evoked potentials, but I am not getting any reliable results at all.

Using hanning window (1-30 Hz) or (4-30 Hz), wavelet transform with absolute baselinetype and relative baselinetype gives me four totally different results (see link)

http://tinyurl.com/y7nerh8v

The EEG data is defined 1000 ms pre stimulus and 1200 ms post stimulus, artifacts removed and preprocessed with baseline correction between 200 ms and 0 ms, bandpass filtered between 0.5 - 30 Hz and referenced to earlobes. The timelocked analysis is attached to the dropbox link as well.

The code I use for hanning window is
%%%%%%%%%%%%%%%%%%

cfg = [];
cfg.output       = 'pow';
cfg.channel      = 'Cz';
cfg.method       = 'mtmconvol';
cfg.taper        = 'hanning';
cfg.foi          = 1:0.025:30;  % OR 4:0.025:30
cfg.t_ftimwin    = 3./cfg.foi;
cfg.toi          = -0.5:0.01:0.7;
TFRwave = ft_freqanalysis(cfg, trialdata);

% Visualization
cfg = [];
cfg.baseline     = [-0.5 -0.1];
cfg.baselinetype = 'absolute';
cfg.maskstyle = 'saturation';
cfg.zlim         = [0 1];
cfg.showlabels   = 'yes';
figure
ft_singleplotTFR(cfg, TFRwave)
%%%%%%%%%%%%%%%%%%

And for wavelet transform is
%%%%%%%%%%%%%%%%%%
cfg = [];
cfg.channel    = 'Cz';
cfg.method     = 'wavelet';
cfg.width      = 7;
cfg.output     = 'pow';
cfg.foi        = 1:0.5:30;
cfg.toi        = -0.5:0.05:1;
TFRwave = ft_freqanalysis(cfg, trialdata);

cfg              = [];
cfg.baseline     = [-0.5 -0.1];
cfg.baselinetype = 'relative'; % OR absolute
cfg.maskstyle    = 'saturation';
cfg.zlim         = [0 1];
cfg.channel      = 'Cz';
figure
ft_singleplotTFR(cfg, TFRwave);
%%%%%%%%%%%%%%%%%%

I have tried the tutorials online, but this doesn't give me any better results...

Does anyone know what I am doing wrong?

Thanks many times!

Best regards,

Alex (Master student




Alexander Mentink
Centre for Human Drug Research
Zernikedreef 8
2333 CL Leiden
The Netherlands
T +31 (0) 71 7517166
amentink at chdr.nl<mailto:amentink at chdr.nl>
http://www.chdr.nl<http://www.chdr.nl/>

Follow us:
<imaged4db2c.PNG><http://www.twitter.com/chdr_nl>       <imagecccaa4.PNG><http://www.linkedin.com/company/centre-for-human-drug-research>




_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170803/4661ab68/attachment.html>


More information about the fieldtrip mailing list