[FieldTrip] FFT on EMG data

Roemer van der Meij r.vandermeij at donders.ru.nl
Wed Apr 20 17:59:51 CEST 2011


Hi Holly,

A few months ago we revised the entire frequency analysis module, if you 
download the latest version you should be fine. In the old situation, 
cfg.foi could only be used for method = mtmconvol, and cfg.foilim was 
the way to go with method = mtmfft. In the new version, you can also 
request specific frequencies with mtmfft using cfg.foi, next to using 
cfg.foilim to define a range. Note though, a cfg.foi = [5 80] (/= not 
cfg.foilim/) will only result in frequency estimates at 5 and 80 Hz, 
whereas a cfg.foilim = [5 80] would result in all possible frequencies 
in that range.

Best,
Roemer




On 20-Apr-11 06:48, Holly Rossiter wrote:
>
> Hi,
>
> I am trying to run an FFT on some EMG data to obtain the peak 
> frequency. This is the script I am using...
>
> D= spm_eeg_load;
>
> emg = D.ftraw(0);
>
> cfg=[];
>
>        cfg.method='mtmfft';
>
>        cfg.output='pow';
>
>        cfg.taper='hanning';
>
>        cfg.channel={'Lforearm'};
>
>        cfg.foi= [5 80];% frequency band - foilim or just foi??
>
>        freq=ft_freqanalysis(cfg,emg);
>
>      figure
>
> semilogy(freq.freq, freq.powspctrm(1,:), 'b-');
>
> However, I keep getting this error...
>
> processing trial 1, ??? Undefined function or variable "dum".
>
> Error in ==> ft_freqanalysis_mtmfft at 345
>
>       fprintf('nfft: %d samples, taper length: %d samples, %d
>
>       tapers\n',length(dum),size(tap,2),numtap);
>
> Error in ==> ft_freqanalysis at 111
>
>   [freq] =
>
>   feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg,
>
>   data);
>
> Do you know how to fix this error?
>
> Thanks,
>
> Holly
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-- 
Roemer van der Meij M.Sc.
PhD student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognition
Radboud University Nijmegen
P.O. Box 9104
6500 HE Nijmegen
The Netherlands
Tel: +31(0)24 3655932
E-mail: r.vandermeij at donders.ru.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20110420/0bc2d047/attachment-0002.html>


More information about the fieldtrip mailing list