[FieldTrip] Single trial dB baseline correction

TORRALBA CUELLO, MIREIA mireia.torralba at upf.edu
Wed Feb 15 17:15:02 CET 2023


Dear FieldTrip community,

I came across a problem when using dB baseline correction for single trial
power-spectrum time courses. My problem is that all values turn to be
negative, even in the baseline. When I averaged across trials and subjects,
to see if this was noise, I found that the values in the baseline were
around -1 dB. I am using revision 20220104.

When I inspected the function ft_freqbaseline, I came to see that the dB
transformation is calculated after averaging the power in the temporal
domain. That is:
I calculate power spectrum:
cfg=[];
cfg.method='mtmconvol';       %STFT
cfg.taper='hanning';       %Taper window used
cfg.pad='nextpow2';
cfg.foi=5:1:7;     %Frequencies of interest (in Hz)
cfg.toi=-0.5-0.24:0.05:1.5;
cfg.t_ftimwin=0.5*ones(length(cfg.foi),1);
cfg.keeptrials='yes';        %We will inspect only the average power
cfg.output='pow';
fdata=ft_freqanalysis(cfg,data);

In ft_freqbaseline:
meanVals = repmat(nanmean(data(:,:,baselineTimes), 3), [1 1 size(data, 3)]);
Then, the dB transform is calculated as follows:
data = 10*log10(data ./ meanVals);

As I mentioned, when I apply this procedure to my data using the following
setting:
cfg=[];
cfg.baseline=[-0.5 0];
cfg.baselinetype='db';
fdata_baseline=ft_freqbaseline(cfg,fdata);

 I get very negative values in the baseline. However, if I first do the
transform and then the baseline like this:

cfg=[];
cfg.operation='10*log10(x1)';
cfg.parameter='powspctrm';
fdata_log=ft_math(cfg,fdata);

cfg=[];
cfg.baseline=[-0.5 0];
cfg.baselinetype='absolute';
fdata_baseline=ft_freqbaseline(cfg,fdata_log);

Taking advantage of the properties of the logarithm, then for trial and
subject averaged data I obtain what I should expect, that the values in the
baseline period are small and fluctuating around zero.

I don't know, maybe the approach for calculating dB correction should be
different for single and trial averaged power spectrum. Or maybe there was
some error in my procedure.

Thanks in advance,

Mireia
Mireia Torralba Cuello
Multisensory Research Group
Center for Brain and Cognition, Universitat Pompeu Fabra
Address: Edifici Mercè Rodoreda 24.313
        c\ Ramon Trias Fargas, 25-27
        08005 Barcelona
https://urldefense.com/v3/__http://www.mrg.upf.edu__;!!HJOPV4FYYWzcc1jazlU!4sCV7xFJiK_VsVjZKxw5wNhPArLa1bmn6sjBfkf4XUH6MHmklClR3K21eGCks43NgrUUJ-t_-sYBqdsDMHjdgCs49UzhNj_C$ 
Tel +34 935422745
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230215/f83f4861/attachment.htm>


More information about the fieldtrip mailing list