[FieldTrip] beamforming tutorial, error using ft_freqanalysis to create CSD matrix
Gio Piantoni
g.piantoni at nin.knaw.nl
Fri Sep 30 09:46:01 CEST 2011
Hi Beth,
dpss is a function of the Signal Processing Toolbox of Matlab
http://www.mathworks.nl/help/toolbox/signal/ref/dpss.html
The Signal Processing Toolbox is a addon which requires an extra
license. You can check the available toolboxes in your matlab
installation by running "ver".
I don't know if there are free implementations of dpss.m, otherwise
you can ask your institute to buy one.
Double and single precision is a way of storing numbers on the computer.
http://www.mathworks.nl/help/techdoc/matlab_prog/f2-12135.html
Double precision numbers have a larger range than single-precision
(and use more memory). Some functions of Matlab, at least in earlier
versions, were unstable with single precision values, that's why it's
better if you store and work with your data as 'double'. Note that the
function 'double_dpss' converts the data into 'double' before passing
it to 'dpss.m' anyway.
You can check if your data is single or double, by doing:
class(data.trial{1})
HTH,
Gio
On Thu, Sep 29, 2011 at 22:54, Belluscio, Beth (NIH/NINDS) [E]
<BelluscB at ninds.nih.gov> wrote:
> Hi group-
>
> When I follow the instructions of the tutorial for localizing oscillatory
> sources using beamforming, I run into a problem calculating the cross
> spectral density matrix. The tutorial does not indicate specifying the
> taper, and therefore ft_freqanalysis defaults to dpss. Then I get an error
> message as below. I confess ignorance that I do not understand what the
> code means when it says “ensure that the input arguments are double
> precision” so I don’t know if my data structure conforms to this
> requirement. My data are time segments of 100 msec in length (each for pre
> and post) sampled at 1200 Hz, with 73 trials. Here are the commands I used
> and the error I got:
>
>
>
> cfg = [];
>
> cfg.method = 'mtmfft';
>
> cfg.output = 'powandcsd';
>
> cfg.tapsmofrq = 4;
>
> cfg.foilim = [20 20];
>
> test = ft_freqanalysis(cfg, dataCB24_03_stim1_Pre) the input is raw data
> with 273 channels and 73 trials processing trials ??? Undefined function or
> method 'dpss' for input arguments of type 'double'.
>
>
>
> Error in ==> ft_specest_mtmfft>double_dpss at 171 tap = dpss(double(a),
> double(b), varargin{:});
>
>
>
> Error in ==> ft_specest_mtmfft at 87
>
> tap = double_dpss(ndatsample,ndatsample*(tapsmofrq./fsample))';
>
>
>
> Error in ==> ft_freqanalysis at 492
>
> [spectrum,ntaper,foi] = ft_specest_mtmfft(dat, time, 'taper',
> cfg.taper, options{:},
>
> 'feedback', fbopt);
>
>
>
> This is specific to the dpss taper (obviously) and when I specify cfg.taper
> = ‘hanning’ the function runs fine. I can create the CSD matrix this way,
> but I’d like to understand why dpss isn’t working and what the requirement
> for double precision means.
>
> Thanks for your help,
>
> Beth.
>
>
>
>
>
>
>
>
>
> Beth Belluscio MD-PhD
>
> Clinical Fellow
>
> Human Motor Control Section
>
> NINDS, NIH
>
> 301-402-3495
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
More information about the fieldtrip
mailing list