Error in FREQANALYSIS

Christian Hesse c.hesse at FCDONDERS.RU.NL
Wed Mar 14 22:12:45 CET 2007


Hi Grant,

Ahhh ... you're trying to do all of this without the signal  
processing toolbox, aren't you. In that case I must apologize for  
having given you slightly inaccurate info before: the DPSS and WINDOW  
functions are from the signal processing toolbox.

Having just had a play with FREQANALYSIS it turns out that in it's  
current version a taper must be specified (e.g., cfg.taper = 'none')  
gives an error. This means that you apparently cannot use FieldTrip  
(in its current form) to do simple, "no-frills" spectral estimation.  
I will have a closer look to see if we can change it so allow  
cfg.taper = 'none', since this means that you could apply your own  
taper to your data before using FREQANALYSIS or just leave it out.

Realistically speaking though, it seems to me that your best options  
are basically a) to get the signal processing toolbox, or b)  to just  
write your own matlab functions to estimate your power spectra (about  
3 lines of code) and then calculate your SEF and MF measures (another  
few lines at most).

Cheers,
Christian



> I am seeing an error in FREQANALYSIS (see output below).  It seems  
> centered around the 'cfg.tapper' field.  I have tried 'dpss',  
> 'hanning' (output below), and 'sine' (which gives an Out of Memory  
> Error).  (Not sure where to find info on WINDOW).
>
>
> My data is in a structure as described here:
> http://www2.ru.nl/fcdonders/fieldtrip/doku.php? 
> id=fieldtrip:documentation:frequently_asked_questions
> (How can I import my own dataformat?)
>
>
> Relevant MATLAB output is below.
>
>
> Pardon me if I am missing something obvious - this is new territory  
> for me.  Any ideas on what might be the problem?
>
>
>
>
> % my data structure with example values
>>> hv1_69
>
> hv1_69 =
>
>       label: {2x1 cell}
>     fsample: 200
>       trial: {[2x48528 double]}
>        time: {[1x48529 double]}
>
>
>>> hv1_69.trial{1}(1,1:5)
>
> ans =
>
>     4.9460    4.2540    1.9510    0.0820    0.6380
>
>>> hv1_69.time{1}(1,1:5)
>
> ans =
>
>          0    0.0050    0.0100    0.0150    0.0200
>
> % here are cfg values
>>> cfg
>
> cfg =
>
>        output: 'pow'
>        method: 'mtmfft'
>     tapsmofrq: 4
>           pad: 'maxperlen'
>         taper: 'dpss'
>        foilim: [0 100]
>
>
>>> [freq] = freqanalysis(cfg, hv1_69);
> ??? Undefined function or method 'dpss' for input arguments of type  
> 'double'.
>
> Error in ==> freqanalysis_mtmfft>double_dpss at 560
> tap = dpss(double(a), double(b), varargin{:});
>
> Error in ==> freqanalysis_mtmfft at 387
>       tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ 
> data.fsample))';
>
> Error in ==> freqanalysis at 193
> [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)),  
> cfg, data);
>
>
>
> % try different 'cfg.taper' value
>>> cfg.taper = 'hanning';
>>> [freq] = freqanalysis(cfg, hv1_69);
> ??? Undefined function or method 'window' for input arguments of  
> type 'char'.
>
> Error in ==> freqanalysis_mtmfft at 393
>       tap = window(cfg.taper, numdatbns)';
>
> Error in ==> freqanalysis at 193
> [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)),  
> cfg, data);
>
>
> %MATLAB version
>>> version
>
> ans =
>
> 7.3.0.267 (R2006b)
>

----------------------------------------------------------------------
Christian Hesse, PhD, MIEEE

F.C. Donders Centre for Cognitive Neuroimaging
P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Tel.: +31 (0)24 36 68293
Fax: +31 (0)24 36 10989

Email: c.hesse at fcdonders.ru.nl
Web: www.fcdonders.ru.nl
----------------------------------------------------------------------




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20070314/6918f8d4/attachment-0002.html>


More information about the fieldtrip mailing list