<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Calibri">Hi Holly,<br>
<br>
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] (<i>= not cfg.foilim</i>) 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. <br>
<br>
Best,<br>
Roemer<br>
<br>
<br>
<br>
</font><br>
On 20-Apr-11 06:48, Holly Rossiter wrote:
<blockquote
cite="mid:004701cbff48$6fe11020$4fa33060$@Rossiter@ion.ucl.ac.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoPlainText">Hi,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I am trying to run an FFT on some EMG
data to obtain the peak frequency. This is the script I am
using...<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">D= spm_eeg_load;<o:p></o:p></p>
<p class="MsoPlainText">emg = D.ftraw(0);<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">cfg=[];<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> cfg.method='mtmfft';<o:p></o:p></p>
<p class="MsoPlainText"> cfg.output='pow';<o:p></o:p></p>
<p class="MsoPlainText"> cfg.taper='hanning';<o:p></o:p></p>
<p class="MsoPlainText"> cfg.channel={'Lforearm'};<o:p></o:p></p>
<p class="MsoPlainText"> cfg.foi= [5 80];% frequency band
- foilim or just foi??<o:p></o:p></p>
<p class="MsoPlainText"> freq=ft_freqanalysis(cfg,emg);<o:p></o:p></p>
<p class="MsoPlainText"> <o:p></o:p></p>
<p class="MsoPlainText"> figure<o:p></o:p></p>
<p class="MsoPlainText">semilogy(freq.freq, freq.powspctrm(1,:),
'b-');<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">However, I keep getting this error...<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">processing trial 1, ??? Undefined
function or variable "dum".<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Error in ==> ft_freqanalysis_mtmfft
at 345<o:p></o:p></p>
<p class="MsoPlainText"> fprintf('nfft: %d samples, taper
length: %d samples, %d<o:p></o:p></p>
<p class="MsoPlainText">
tapers\n',length(dum),size(tap,2),numtap);<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Error in ==> ft_freqanalysis at 111<o:p></o:p></p>
<p class="MsoPlainText"> [freq] =<o:p></o:p></p>
<p class="MsoPlainText">
feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg,<o:p></o:p></p>
<p class="MsoPlainText"> data);<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Do you know how to fix this error?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Thanks,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Holly<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<font size="3"><font color="darkblue"><font face="calibri">Roemer
van der Meij M.Sc.<br>
PhD student<br>
Donders Institute for Brain, Cognition and Behaviour<br>
Centre for Cognition<br>
Radboud University Nijmegen<br>
P.O. Box 9104<br>
6500 HE Nijmegen<br>
The Netherlands<br>
Tel: +31(0)24 3655932<br>
E-mail: <a class="moz-txt-link-abbreviated" href="mailto:r.vandermeij@donders.ru.nl">r.vandermeij@donders.ru.nl</a><br>
</font></font></font></div>
</body>
</html>