<div dir="ltr"><div>Hi Yanki,</div><div><br></div><div>I suspect something is off with your sampling frequency / triallength; <br></div><div><br></div><div>Try debugging:</div><div><br></div><div>type: dbstop if error</div><div><br></div><div>then run again, and see what is happening on line 102-103;</div><div><br></div><div>
if round(pad * fsample) < ndatsample<br>  ft_error('the padding that you specified is shorter than the data');<br>end

</div><div><br></div><div> Are the values of sample & ndatsample what you would expect?<br></div><div><br></div><div></div><div></div><div>Hope this helps,</div><div>Stephen<br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op ma 1 feb. 2021 om 11:29 schreef Yankı Tandırcıoğlu <<a href="mailto:yankitandircioglu@gmail.com">yankitandircioglu@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">Dear community,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">My name is Yankı Tandırcıoğlu and I am a student at Middle East Technical University. Currently I am analyzing MEG dataset.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">I tried using ft_freqanalysis to obtain TFR. However, when I call ft_freqanalysis, I receive the following error message:</p><div style="box-sizing:border-box;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px"><div style="box-sizing:border-box;background:rgb(240,240,240) none repeat scroll 0% 0%;padding:0.8em;border-radius:0.3em;margin-bottom:0.5rem"><pre style="white-space:pre-wrap;box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13.2px;margin-top:0px;margin-bottom:0px;overflow:auto;color:rgb(33,37,41);background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"><code style="box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:inherit;color:inherit;word-break:normal">Error using ft_specest_mtmconvol (line 103)<br>the padding that you specified is shorter than the data
</code></pre></div></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">The cfg and data I use are as follows:</p><div style="box-sizing:border-box;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px"><div style="box-sizing:border-box;background:rgb(240,240,240) none repeat scroll 0% 0%;padding:0.8em;border-radius:0.3em;margin-bottom:0.5rem"><pre style="white-space:pre-wrap;box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13.2px;margin-top:0px;margin-bottom:0px;overflow:auto;color:rgb(33,37,41);background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"><code style="box-sizing:border-box;font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:inherit;color:inherit;word-break:normal">cfg                         = [];<br>cfg.channel      = {'megplanar'};<br>cfg.lpfilter = 'yes'<br>cfg.lpfreq = 150<br>cfg.continuous = 'yes'<br>RestCondition_1 = ft_preprocessing(cfg, temp);
<p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US"><br></span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg            = [];</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.output    = 'pow';</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.channel    = 'megplanar';</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.method     = 'mtmconvol';</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.taper      = 'hanning';</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.foi        = 2:1:40;</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.toi        = [0:0.05:2];</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.trials     = 'all';</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.t_ftimwin  = ones(length(cfg.foi),1).*0.5;</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">cfg.keeptrials= 'yes'; %% we keep the single trials</span></p><p class="MsoNormal" style="margin:0cm;font-size:12pt;font-family:Calibri,sans-serif"><span lang="EN-US">freq_Rest1    = ft_freqanalysis(cfg,RestCondition_1);</span></p></code></pre></div></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">Can someone tell me if there is something wrong with the cfg settings I use or if I am doing something wrong at any other place? T Any help would be appreciated.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">Best,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:1rem;text-align:justify;color:rgb(12,84,96);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px">Yankı Tandırcıoğlu</p></div><div><br></div></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>