<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Dear all,</p>
<p>Below please find some code which illustrates the issue I'm having.</p>
<p>Example data can be found here: <a id="LPlnk792796" href="https://www.dropbox.com/s/5bgpawph49vkgoo/data_fft_vs_conv.mat?dl=0" class="OWAAutoLink">https://www.dropbox.com/s/5bgpawph49vkgoo/data_fft_vs_conv.mat?dl=0</a></p>
<p><br>
</p>
<p></p>
<div>The code results in a plot of the PSD, showing how both mtmfft and mtmconvol  yield (more or less) similar results, but only after the results from mtmfft are multiplied by 10.<br>
<br>
Again, I'd be grateful for any clarification on why this might be!<br>
Cheers,<br>
Ulrich<br>
<br>
<br>
%%%%%%%%%%%%% MTMFFT code %%%%%%%%%%%%%%%%%%%%%%%%%<br>
 <br>
                cfg = [];<br>
                cfg.continuous = 'no';<br>
                cfg.channel      = {'all', '-VEOG', '-HEOG'}<br>
                cfg.output = 'pow';<br>
                cfg.method       = 'mtmfft';<br>
                cfg.foi          =  1:0.5:30;<br>
                cfg.taper   = 'hanning';<br>
                cfg.tapsmofrq = 2 +(0*(cfg.foi));<br>
                cfg.keeptapers = 'no';<br>
                cfg.keeptrials   = 'no';<br>
                cfg.pad        = 5;<br>
                freq_fft = ft_freqanalysis(cfg, data);<br>
                <br>
      <br>
%%%%%%%%%%%%% MTMCONVOL code %%%%%%%%%%%%%%%%%%%%%%%%%<br>
<br>
                taplen = 695;<br>
                cfg = [];<br>
                cfg.continuous = 'no';<br>
                cfg.channel      = {'all', '-VEOG', '-HEOG'}<br>
                cfg.output = 'pow';<br>
                cfg.method       = 'mtmconvol';<br>
                cfg.foi          =  1:0.5:30;<br>
                cfg.toi          =  0.25; <br>
                cfg.taper   = 'hanning';<br>
                cfg.tapsmofrq = 2 +(0*(cfg.foi));                   cfg.t_ftimwin    = ones(length(cfg.foi),1).* (taplen /1000); %
<br>
                cfg.keeptapers = 'no';<br>
                cfg.keeptrials   = 'no';<br>
                cfg.pad        = 5;<br>
                freq_conv = ft_freqanalysis(cfg, data);<br>
                <br>
<span>%%%%%%%%%% plot the two different results for comparison %%%%%%%%%%%%%%%%%</span><br>
<br>
CH1_mean_fft = freq_fft.powspctrm(1,:);<br>
CH1_mean_conv = freq_conv.powspctrm(1,:);<br>
<br>
<span>% mtmfft data multiplied by 10, which puts them in a similar order of  magnitude  as the results from mtmconvol</span><br>
CH1_mean_fft10 = freq_fft.powspctrm(1,:) * 10;  <br>
<br>
            <br>
<br>
figure; plot(CH1_mean_conv); hold on; plot(CH1_mean_fft10); hold on; plot(CH1_mean_fft);<br>
  </div>
<br>
<p></p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> fieldtrip-bounces@science.ru.nl <fieldtrip-bounces@science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen@donders.ru.nl><br>
<b>Sent:</b> 10 August 2016 11:01<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] mtmfft vs. mtmconvol</font>
<div> </div>
</div>
<div>Dear Bumper,<br class="">
<div>
<div class="" style="word-wrap:break-word">
<div class=""><br class="">
</div>
<div class="">It may be helpful to provide the list with some example code + data, should anybody be keen to look into this.</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Jan-Mathijs</div>
<div class=""> </div>
<div class=""><br class="">
</div>
<div class=""> </div>
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 09 Aug 2016, at 19:19, Pomper, Ulrich <<a href="mailto:u.pomper@ucl.ac.uk" class="">u.pomper@ucl.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" class="" style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; font-size:12pt; background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<div class="" style="margin-top:0px; margin-bottom:0px">bump....</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Has anybody encountered this issue before?</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Any suggestion would be highly appreciated!</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Many Thanks!<br class="">
</div>
<br class="">
<br class="">
<div class="" style="">
<hr tabindex="-1" class="" style="display:inline-block; width:602.6875px">
<div id="divRplyFwdMsg" dir="ltr" class=""><font class="" style="font-size:11pt" face="Calibri, sans-serif"><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>
 <<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>> on behalf of Pomper, Ulrich <<a href="mailto:u.pomper@ucl.ac.uk" class="">u.pomper@ucl.ac.uk</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>05 August 2016 17:25<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a><br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>[FieldTrip] mtmfft vs. mtmconvol</font>
<div class=""> </div>
</div>
<div class="">
<div id="divtagdefaultwrapper" class="" style="font-size:12pt; background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<div class="" style="margin-top:0px; margin-bottom:0px">Dear all,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">I have a question regarding different results I get from spectral analysis using mtmfft versus mtmconvol.</div>
<div class="" style="margin-top:0px; margin-bottom:0px">In short, the spectral power across frequencies is very similar for both methods, but<span class="Apple-converted-space"> </span><span class="">for some reason my results are an order of magnitude larger
 when using mtmconvol.</span><span class="Apple-converted-space"> </span>In other words, the power spectral density plots for both methods are highly overlapping, but only after I multiply the results of mtmfft by 10.</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Is there any evident reason for this? Are the two methods just outputting different units/ scales?<span class="Apple-converted-space"> </span><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">(I ran both using almost identical settings. For mtmconvol I used a single timepoint at the center of my data period, with a taper length identical to the length of the data period used in mtmfft. All
 other parameters are the same).</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Cheers,</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Ulrich<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
</div>
</div>
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">fieldtrip
 mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important"><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a></span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important"><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>