[FieldTrip] Much faster lcmv beamformer with mtimesx
Bruno L. Giordano
brungio at gmail.com
Wed Aug 26 20:16:20 CEST 2015
Hello,
I worked on optimizing the beamformer lcmv function, and got
improvements that might be quite interesting.
I am beamforming a 54k time points x 240 sensors signal on a 44k nodes
grid. On a 16 cores machine it takes around 520 s to do it using the
beamformer_lcmv function (fixedori = 'yes') , whereas it takes around 26
s to do it on the same machine using the optimized function.
To achieve the speed up, I stack the filters on different pages of a 3D
matrix, and use mtimesx to do the projection, with one single command,
and no for loop across the grid nodes. Mtimesx is called in 'MATLAB'
mode: more improvements are likely if it is called using one of the
other faster options. I am also keeping the projection as one single
matrix, instead of redistributing across a cell structure with one
element per grid node (this operation also takes quite some time).
Mtimesx can be downloaded here:
http://uk.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with-multi-dimensional-support
If you are interested, I can share the hacked lcmv beamformer function.
Best,
Bruno
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bruno L. Giordano, PhD
Institute of Neuroscience and Psychology
58 Hillhead Street, University of Glasgow
Glasgow, G12 8QB, Scotland
T +44 (0) 141 330 5484
Www: http://www.brunolgiordano.net
Email charter: http://www.emailcharter.org/
More information about the fieldtrip
mailing list