[FieldTrip] Memory saving in ft_frequanalysis

Claudio Georgii Claudio.Georgii at stud.sbg.ac.at
Tue Jun 14 14:14:47 CEST 2016


Hi fieldtrip list,

we recently ran into some memory issues using the cfg.output = 'powandcsd'
option in ft_frequanalysis.

We solved the issue by:
(1) changing the following line of code (ft_freqanalysis; line 573-574:

if csdflg, crsspctrm     =
complex(nan(ntrials,nchancmb,nfoi,ntoi,cfg.precision),nan(ntrials,nchancmb,nfoi,ntoi,cfg.precision));
end

into

if csdflg, crsspctrm     =
nan+nan(ntrials,nchancmb,nfoi,ntoi,cfg.precision)*1i; end

and accordingly,

if fftflg, fourierspctrm =
complex(nan(ntrials,nchan,nfoi,ntoi,cfg.precision),nan(ntrials,nchan,nfoi,ntoi,cfg.precision));
end

into

if fftflg, fourierspctrm =
nan+nan(ntrials,nchan,nfoi,ntoi,cfg.precision)*1i;       end

(2) defining cfg.precision as 'single'

This two procedures saves a huge amount of memory (~ the order of 4).
Now, we wanted to ask, whether these changes/adaptions are okay and do not
lead to spurious results? Is there a reason on performing wavelet
convolution on double instead of single precision?

Thank you in advance.

Best,
Claudio Georgii



-- 
Claudio Georgii, MSc.
Phd student
University of Salzburg - Department of Psychology
Eating Behavior Laboratory
Hellbrunnerstra├če 34
5020 Salzburg - Austria

Phone: 0043- (0)662 8044 5164
E-Mail: claudio.georgii at sbg.ac.at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160614/60e84d09/attachment-0001.html>


More information about the fieldtrip mailing list