[FieldTrip] Using cfg.baseline and cfg.toi

Eno Umotong enoumotong at hotmail.com
Thu Aug 16 12:33:37 CEST 2018


Many thanks for all your responses!

Indeed the baseline period did include NaNs. 

I was just double checking that fieldtrip maintained the same t=0 as I had defined in the eeglab interface.

Last question (hopefully) Does the baseline period need to be the same length as the period of frequency analysis?

Thanks again!


On 16/08/2018, 08:25, "fieldtrip on behalf of Eelke Spaak" <fieldtrip-bounces at science.ru.nl on behalf of e.spaak at donders.ru.nl> wrote:

    Hi Eno,
    
    My hunch is that after the call to ft_freqanalysis, the time interval
    comprising your baseline contains NaNs. The subsequent call to
    ft_freqbaseline will subtract those NaNs from all time points, which
    will result in all NaNs.
    
    Have a look here to understand why there are NaNs after
    ft_freqanalysis:
    http://www.fieldtriptoolbox.org/faq/why_does_my_tfr_contain_nans And
    then ensure you select a baseline window that does not contain NaNs.
    
    Also, make sure to use *separate* cfg structs per FT function call to
    avoid confusing yourself. So:
    
    cfg = [];
    ...
    freq = ft_freqanalysis(cfg, data);
    
    cfg = [];
    ...
    freq_bsl = ft_freqbaseline(cfg, freq);
    
    Cheers,
    Eelke
    
    On 15 August 2018 at 22:32, Eno Umotong <enoumotong at hotmail.com> wrote:
    >
    >
    >
    >
    >
    >
    > Hi there,
    >
    >
    >
    > I’m having trouble extracting the baseline from my time frequency data.
    >
    >
    >
    > I’m using the function like this:
    >
    >
    >
    > cfg = [];
    >
    > cfg.output = ‘pow’;
    >
    > cfg.channel = …
    >
    > cfg.taper = ‘hanning’;
    >
    > cfg.foi = …
    >
    > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5;
    >
    > cfg.toi = …
    >
    > cfg.baseline = ..
    >
    > cfg.baselinetype = ‘absolute’;
    >
    > cfg.parameter = ‘powspctrm’;
    >
    > freq = ft_freqanalysis(cfg, Dataset);
    >
    > TFRHann3 = ft_freqbaseline(cfg,freq);
    >
    >
    >
    > How can I use this function correctly please? I’m sorry to bother you with
    > this. I couldn’t find assistance online. TFRHann3.powspctrum returns a
    > matrix full of NaN. I’m sure this is obvious to you.
    >
    >
    >
    > Just one more question. When selecting my time window of interest for
    > frequency analysis using ft_freqanalysis and specifying cfg.toi, would 0
    > represent my stimulus (as specified by epoch selection in eeglab interface)?
    >
    >
    >
    > Many thanks again for your help.
    >
    >
    >
    >
    >
    > Many thanks for your help.
    >
    >
    >
    >
    > _______________________________________________
    > fieldtrip mailing list
    > https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
    > https://doi.org/10.1371/journal.pcbi.1002202
    >
    
    _______________________________________________
    fieldtrip mailing list
    https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
    https://doi.org/10.1371/journal.pcbi.1002202
    






More information about the fieldtrip mailing list