[FieldTrip] 'db' baseline

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Tue Jan 5 09:30:28 CET 2021

Hi Marta,

Concerning your first question; I would check your (mean) baseline values
for those trials that give a problem. Note that the code for
ft_freqbaseline is pretty straightforward:

[line 198]

if (strcmp(baselinetype, 'absolute'))
  data = data - meanVals;
elseif (strcmp(baselinetype, 'relative'))
  data = data ./ meanVals;
elseif (strcmp(baselinetype, 'relchange'))
  data = (data - meanVals) ./ meanVals;
elseif (strcmp(baselinetype, 'normchange')) || (strcmp(baselinetype,
  data = (data - meanVals) ./ (data + meanVals);

*elseif (strcmp(baselinetype, 'db'))  data = 10*log10(data ./ meanVals);*

You could place a breakpoint here, inspect the baseline values, and see if
that might clear things up.

I'm afraid I don't understand your second question as bandpass filtering
doesn't result in TF, nor in a matrix (but a cell struct). In any case, in
my limited understanding of filters, increasing the order increases the
temporal width of the filter, so you might have some short/incomplete
trials that might be causing the problem?

Hope this helps your debugging,

Op ma 4 jan. 2021 om 15:02 schreef Marta Andujar <marta.andujar at uniroma1.it

> Dear All,
> I am performing a TF analysis via wavelet algorithm. I am using a db
> baseline normalization. For few trials and only in some channels and
> conditions, after this procedure  i get -inf as power value. Raw data do
> not contain NaN. Why I get this result? By inspecting the power at single
> trial level I could not see any "overnormal" noise in those trials.
> A second question concerns the prerocessing: I am applying a butterwoth
> bandpass([0.5 1000 Hz]) filter to raw data sampled at 24 KHz. If I set the
> filter order to 5, the resulting TF matrix is an m by n NaN matrix. However
> this occurs again, only for some channels and conditions. At the moment I
> am applying a second order filter to avoid this problem but I would like to
> figure out why this occurs.
> Many thanks
> Marta
> ________________________________________________________
> Le informazioni contenute in questo messaggio di posta elettronica sono
> strettamente riservate e indirizzate esclusivamente al destinatario. Si
> prega di non leggere, fare copia, inoltrare a terzi o conservare tale
> messaggio se non si รจ il legittimo destinatario dello stesso. Qualora tale
> messaggio sia stato ricevuto per errore, si prega di restituirlo al
> mittente e di cancellarlo permanentemente dal proprio computer.
> The information contained in this e mail message is strictly confidential
> and intended for the use of the addressee only.  If you are not the
> intended recipient, please do not read, copy, forward or store it on your
> computer. If you have received the message in error, please forward it back
> to the sender and delete it permanently from your computer system.
> ------------------------------
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210105/dfe9e0a3/attachment.htm>

More information about the fieldtrip mailing list