[FieldTrip] problems using ft_freqanalysis

Joseph Dien jdien07 at mac.com
Fri May 20 04:30:59 CEST 2011


Hi,
  I'm just starting to get up to speed on spectral analysis (I'm an ERPer).  
I'm using the following set-up:

I tried the following (for one second long trials with an Fs of 250Hz and interest in frequencies below 30Hz):

cfg.method='mtmwelch';
cfg.output='pow';
[freq] = ft_freqanalysis(cfg, data);

I got the error message:

-------------------------
the input is raw data with 128 channels and 160 trials
'mtmwelch' has not been implemented yet in the specest toolbox, the old implementation is being used
taking every sample as time of interest
the input is raw data with 128 channels and 160 trials
??? Error using ==> ft_freqanalysis at 216
you must specify a smoothing parameter with taper = dpss

Error in ==> ft_freqanalysis_mtmwelch at 107
freq = ft_freqanalysis(cfgconvol, data);

Error in ==> ft_freqanalysis at 271
[freq] =
feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg,
data);

-----------------------
Two things:

1) What would be an appropriate smoothing parameter?

2) Is this a bug?  It defaulted to dpss as specified by the documentation but it didn't provide a default smoothing parameter so the default still resulted in a crash.

Anyway, given the advice in the tutlrial to use a hanning window rather than a multi-taper like dpss for frequencies below 30, I tried the following:

cfg.foi=[1:1:30];
cfg.taper='hanning';

which resulted in:

--------------------------
>> [freq] = ft_freqanalysis(cfg, data);
the input is raw data with 128 channels and 160 trials
'mtmwelch' has not been implemented yet in the specest toolbox, the old implementation is being used
taking every sample as time of interest
the input is raw data with 128 channels and 160 trials
processing trials
??? Reference to non-existent field 't_ftimwin'.

Error in ==> ft_freqanalysis at 454
      [spectrum_mtmconvol,ntaper,foi,toi] =
      ft_specest_mtmconvol(dat, time, 'timeoi', cfg.toi,
      'timwin', cfg.t_ftimwin, 'taper', ...

Error in ==> ft_freqanalysis_mtmwelch at 107
freq = ft_freqanalysis(cfgconvol, data);

Error in ==> ft_freqanalysis at 271
[freq] =
feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg,
data);


--------------------
What am I doing wrong?  I looked through the code but couldn't figure out what the problem was.  I am very confused...

fieldtrip-20110519
MATLAB Version 7.11.0.584 (R2010b)
Operating System: Mac OS X  Version: 10.6.7 Build: 10J869 


>> cfg

cfg = 

    dataset: 'SLI_3011m_40m_POA.egis'
     method: 'mtmwelch'
     output: 'pow'
      taper: 'hanning'
  tapsmofrq: 4
        foi: [1x30 double]

>> data

data = 

         hdr: [1x1 struct]
       label: {128x1 cell}
        time: {1x160 cell}
       trial: {1x160 cell}
     fsample: 250
  sampleinfo: [160x2 double]
         cfg: [1x1 struct]


Thanks for any help you can give!

Joe



More information about the fieldtrip mailing list