<div dir="ltr"><div>Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot!</div><div> </div><div>Best,</div><div>Jinyi</div><font color="#228b22" face="Courier New"><font color="#228b22" face="Courier New"><font color="#228b22" face="Courier New"><div> </div><div><p> </p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">%% frequency analysis</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg<span>              </span>= [];</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.output<span>       </span>= </span><span style="color:rgb(160,32,240);font-family:"Courier New";font-size:10pt">'pow'</span><span style="color:black;font-family:"Courier New";font-size:10pt">;</span><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">%'fourier';%</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">% cfg.channel<span>      </span>= 'MEG';</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.method<span>       </span>= </span><span style="color:rgb(160,32,240);font-family:"Courier New";font-size:10pt">'mtmconvol'</span><span style="color:black;font-family:"Courier New";font-size:10pt">;</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.taper<span>        </span>= </span><span style="color:rgb(160,32,240);font-family:"Courier New";font-size:10pt">'hanning'</span><span style="color:black;font-family:"Courier New";font-size:10pt">;</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.foi<span>          </span>= 2:1:40;<span>                         </span></span><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">% analysis
2 to 30 Hz in steps of 2 Hz </span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.t_ftimwin<span>    </span>= ones(length(cfg.foi),1).*0.5;<span>   </span></span><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">% length of time window = 0.5 sec</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.toi<span>          </span>= -0.5:0.05:4;<span>                  </span></span><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">% time
window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms)</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">TFRhann = ft_freqanalysis(cfg,
data);</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">%% visualize</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg = [];</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.baseline<span>     </span>= [-0.9 -0.1];</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.baselinetype = </span><span style="color:rgb(160,32,240);font-family:"Courier New";font-size:10pt">'absolute'</span><span style="color:black;font-family:"Courier New";font-size:10pt">;<span>  </span></span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.maskstyle<span>    </span>= </span><span style="color:rgb(160,32,240);font-family:"Courier New";font-size:10pt">'saturation'</span><span style="color:black;font-family:"Courier New";font-size:10pt">;<span>    </span></span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.zlim<span>         </span>= [-3e-7 3e-7];<span>    </span></span><span style="color:forestgreen;font-family:"Courier New";font-size:10pt">%</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">cfg.channel<span>      </span>= </span><span style="color:rgb(160,32,240);font-family:"Courier New";font-size:10pt">'26'</span><span style="color:black;font-family:"Courier New";font-size:10pt">;</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">figure </span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0in 0in 0pt;line-height:normal"><span style="color:black;font-family:"Courier New";font-size:10pt">ft_singleplotER(cfg, TFRhann)</span><span style="font-family:"Courier New";font-size:12pt"></span></p><font color="#000000" face="Times New Roman" size="3">

</font></div></font><div> </div></font><div> </div></font><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-07 1:33 GMT-05:00 Tzvetan Popov <span dir="ltr"><<a href="mailto:tzvetan.popov@uni-konstanz.de" target="_blank">tzvetan.popov@uni-konstanz.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Jinyi,<br>
You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER.<br>
Good luck<br>
Tzvetan<br>
<br>
<br>
<br>
> Am 07.11.2014 um 00:23 schrieb Jinyi Long <<a href="mailto:longjinyi@gmail.com">longjinyi@gmail.com</a>>:<br>
<span>><br>
> Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks!<br>
><br>
> Best,<br>
> Jinyi<br>
</span>> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br></div>