[Eeglablist] single and double precision in eeglab / matlab

Arnaud Delorme arno at ucsd.edu
Mon Feb 6 10:17:48 PST 2017


Hi Clayton,

I think most of the operations using 32-bit single precision numbers are supported since more than 5 years ago (at least filtering). Also, historically, we used to be limited with memory in Matlab for single dataset processing. This is only rarely the case anymore.

Data should be stored on disk as single precision (disk usage remains high especially in EEGLAB 14, where all the single trial estimates are stored at the STUDY level) but for processing one may use single or double precision. As far as using new SP toolbox tools, remember that in most cases, precision will not make a noticeable difference (so it is not like some process will fail when using single, and then magically work when using double). If, I can find the time, I will try to run two pipelines one in single and one in double precision (including ICA and filtering) to assess if there is a real gains terms of SNR.

Arno

> Hi Arno, 
> 
> A number of years ago I looked at converting data to single during some of the internal operations for the Makeig implementation of Bell & Sejnowski ICA (ie. runica). This was to try and reduce memory usage for big data files. A few things came up in this process, I submitted a couple of bug reports, and you and I emailed back and forth. 
> 
> One thing I found out (thanks to Germán Gómez-Herrero and my own fiddling) was that many of the matlab toolboxes did not support single precision data at the time, and were not graceful in how they failed (ie. they messed up your data without telling you that anything was wrong). In particular, the signal processing toolbox did this.
> 
> Not a big deal… you just have to remember to cast data to double before you apply any operations from the SP toolbox, as is done internally for filtering, resampling etc. But it would be easy for someone to be unaware of this, try some new approach with the SP toolbox, and find themselves with a mess… 
> 
> It wouldn’t surprise me if Mathworks has updated the commercial toolboxes to consistently and properly support singles. But it also wouldn’t surprise me if they haven’t. A few minutes of google hasn’t given me a clear answer. Do you know? 
> 
> thanks, 
> clayton
> 
> 
> 
> 
> 
>> 
>> From: Arnaud Delorme <arno at ucsd.edu <mailto:arno at ucsd.edu>>
>> Subject: Re: [Eeglablist] ICA running very slowly
>> Date: February 4, 2017 at 4:47:32 PM GMT+1
>> To: Andreas Widmann <widmann at uni-leipzig.de <mailto:widmann at uni-leipzig.de>>
>> Cc: eeglablist <eeglablist at sccn.ucsd.edu <mailto:eeglablist at sccn.ucsd.edu>>
>> 
>> 
>> Yes, this is right which is why the data is automatically converted to double precision when filtering, resampling and ICA.
>> 
>> Arno
> 
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20170206/4ac75a96/attachment.html>


More information about the eeglablist mailing list