[Eeglablist] Single-precision data vs. double-precision data in Matlab

Germán Gómez-Herrero german.gomezherrero at tut.fi
Fri Apr 18 02:35:33 PDT 2008


Hi,

> Is the current best practice to use single precision representation of
> the
> raw EEG data?
> 

In my opinion this is definitely not the best practice because MATLAB
support for single precision data is still quite unstable and important
MATLAB features will not work properly with single precision data. For
instance, MATLAB's Signal Processing Toolbox does not accept single
precision data. See the MATLAB's SPT product overview here, under Supported
data types:
http://www.mathworks.com/access/helpdesk/help/toolbox/signal/ 

In my opinion MATLAB's developers are making little effort to stress the
fact that "If you input single-precision floating-point or integer data, you
should not expect to receive correct results". To be precise they should say
that you should expect wrong results... Before I became aware of this, I was
happily using single precision data but after a painful error debugging
experience I gave it up almost completely (unless memory constraints force
me using single precision). The big problem here is that, if you use single
precision with MATLAB's SPT you might get completely well formatted ouputs
which will not trigger any error in your code but that are completely wrong!
Therefore finding such an error can be really difficult. And I am not sure
whether this problems with single precision data occur in other MATLAB
toolboxes or even in some of the built-in MATLAB functions.

> I've just upgraded from EEGLab 4.515 to 6.x  and I've noticed that the
> data
> are not stored in the EEG.data structure as single precision numbers.
> In my
> experimentation, I found that runica in some cases does yield different
> results for double vs. single precision data.
> 
> Is there a quick and easy way to change the representation of the data
> in
> EEGLab 6.x back to double precision representation?
> 

As far as I know this was not possible in the current version of EEGLAB. I
have modified slightly functions eeg_checkset.m, eeg_options.m and
eeg_optionsbackup.m in order to allow the user choose whether to use single
precision or not. You can get the modified versions here:

http://www.cs.tut.fi/~gomezher/nosingle.zip 

You just need to change the default EEGLAB functions in the folder
functions/adminfunc/ with the ones I modified. After that EEGLAB will store
the data by default in double precision. However, the user can return easily
to the default single precision using the EEGLAB menu File>Memory. I would
suggest EEGLAB´s developers to include this option in future releases of
EEGLAB.

Hope that helps,
Germán



> 
> 
> 
> Regards,
> 
> Phil Zeman
> 
> 
> 
> 
> ----- Original Message -----
> From: "Julie Onton" <julie at sccn.ucsd.edu>
> To: <sklein at berkeley.edu>
> Cc: <eeglablist at sccn.ucsd.edu>
> Sent: Monday, April 14, 2008 4:16 PM
> Subject: Re: [Eeglablist] Time-frequency analysis (subtraction first or
> analysis first)
> 
> 
> >I agree that the time/frequency analysis should be performed first,
> and
> >THEN subtraction.
> > Subtraction of the EEG time courses (ie, in the time domain) will
> give a
> > very different result
> > compared to the (frequency domain) ERSP subtraction. EEGLAB's
> newtimef()
> > called from the
> > commandline performs this very operation on two datasets
> corresponding to
> > two different
> > conditions.
> >
> > Best, Julie
> >
> > --
> > Julie Onton, PhD
> > Swartz Center for Computational Neuroscience
> > Institute for Neural Computation
> > University of California, San Diego
> > (858) 458-1927 ext 17
> > http://sccn.ucsd.edu/~julie
> >
> >> Dear Arnaud,
> >> Are you sure about your recommendation of the first statement being
> >> correct?
> >> Suppose the two conditions happen to be quite similar in producing
> alpha
> >> or
> >> gamma oscillations. Since the two conditions are the same, one would
> like
> >> the desired outcome to be a *cancellation *of the two power plots.
> >> However,
> >> since the occurrence of the oscillations likely happen at different
> time
> >> points (and with different phases) early subtraction would still
> leave
> >> the
> >> oscillations and the outcome would be equal or even stronger power
> rather
> >> than cancellation. Or am I thinking about it improperly?
> >> Stan
> >>
> >> On Sun, Apr 13, 2008 at 10:53 AM, Arnaud Delorme <arno at cerco.ups-
> tlse.fr>
> >> wrote:
> >>
> >>> Dear Hsu,
> >>>
> >>> only your first statement is correct. The second one could be
> correct if
> >>> you could pair the trials, but it would be very rare that you would
> want
> >>> to do this (since trials are recorded at different times and are
> usually
> >>> not paired between conditions). Look up the help of the newtimef
> >>> function which allows computing differences between power between
> >>> different conditions and newcrossf which allows computing
> difference
> >>> between phase coherence images.
> >>>
> >>> Best,
> >>>
> >>> Arno
> >>>
> >>> Hsu, Shen-Mou wrote:
> >>> > Dear list-memebers,
> >>> >
> >>> > Suppose that I am interested in comparing two conditions A and B
> in
> >>> terms of their power and phase coherence. I was wondering which one
> of
> >>> the
> >>> following steps is more theoretically correct. 1. After
> segmentation,
> >>> calculate the EEG differences between the condition A and B and
> then
> >>> perform
> >>> time-frequency analysis on the differences. 2. After segmentation,
> >>> perform
> >>> time-frequency analysis on the EEG data of the condition A and B
> >>> respectively and then compute the power or phase coherence
> differences
> >>> between two conditions. Any comments would be much appreciated.
> >>> >
> >>> > Many thanks,
> >>> >
> >>> > Shen-Mou Hsu
> >>> >
> >>> _______________________________________________
> >>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> >>> To unsubscribe, send an empty email to
> >>> eeglablist-unsubscribe at sccn.ucsd.edu
> >>> For digest mode, send an email with the subject "set digest mime"
> to
> >>> eeglablist-request at sccn.ucsd.edu
> >>>
> >> _______________________________________________
> >> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> >> To unsubscribe, send an empty email to
> >> eeglablist-unsubscribe at sccn.ucsd.edu
> >> For digest mode, send an email with the subject "set digest mime" to
> >> eeglablist-request at sccn.ucsd.edu
> >
> > _______________________________________________
> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> > To unsubscribe, send an empty email to
> > eeglablist-unsubscribe at sccn.ucsd.edu
> > For digest mode, send an email with the subject "set digest mime" to
> > eeglablist-request at sccn.ucsd.edu
> 
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-
> unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu





More information about the eeglablist mailing list