[FieldTrip] baselinetype decibel and plotting error

Jörn M. Horschig jorn at artinis.com
Wed Nov 26 08:44:33 CET 2014


Hi Ben,

nice to see here, and that you are actively using FieldTrip ;)
My guess is that the error occurs because you have negative values that you
want to transform, e.g. because you are taking a contrats between
conditions. Converting to decibels involves taking the logarithm, and the
logarithm of negative numbers is not good (i.e. you get complex numbers
out). A simple solution is to first take the logarithm of e.g. individual
conditions and then subtract or, which is equivalent, dividing the two
conditions from one another and then taking the logarithm.

Best,
Jörn

 

--

 

Jörn M. Horschig, Software Engineer

 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 

 

From: fieldtrip-bounces at science.ru.nl
[mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Lier Ben
Sent: Tuesday, November 25, 2014 1:44 PM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] baselinetype decibel and plotting error

 

Hi,

I would like to plot my data in decibel. It works fine when running
singleplotTFR, however I get an error when i use the plot interactivity to
select a time/freq range within the singleplotTFR. The resulting topoplot
has no color (it does show the contourlines of the data) and the layout
outline is stretched (should be square).

running topoplotTFR directly works fine and using the other baselinetypes is
also no problem. the error is only when interacting with a spectrogram in
decibel.


Error using surf (line 75)
X, Y, Z, and C cannot be complex

Error in ft_plot_topo (line 251)
  h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none',
'FaceColor', shading);

Error in topoplot_common (line 704)
  ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,...

Error in ft_topoplotTFR (line 186)
[cfg] = topoplot_common(cfg, varargin{:});

Error in ft_singleplotTFR>select_topoplotTFR (line 579)
ft_topoplotTFR(cfg, varargin{:});

Error in ft_select_range>evalCallback (line 325)
    feval(funhandle, funargs{:}, val, cmenulab);

Error in ft_select_range (line 159)
          evalCallback(callback, userData.range);
 
Error while evaluating figure WindowButtonDownFcn


its not the end of the world, but its such a nice feature to have...

thank you,

Ben

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


More information about the fieldtrip mailing list