<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Jinyi,
<div><br>
</div>
<div>The name of the function gives you a clue on what function to use for plotting. <span style="font-size: 10pt;">ft_singleplotER  vs. ft_singleplotTFR. <br>
ER for event-related potentials/fields, and TFR = time frequency data.</span></div>
<div><br>
</div>
<div>Please take a look at this tutorial, all the questions you have asked can be found here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis<a href="http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis" target="_blank">http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis</a></div>
<div><br>
</div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">Nietzsche </span></div>
<div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF505213" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> fieldtrip-bounces@science.ru.nl [fieldtrip-bounces@science.ru.nl] on behalf of Jinyi Long [longjinyi@gmail.com]<br>
<b>Sent:</b> 07 November 2014 14:24<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] power-frequency figure<br>
</font><br>
</div>
<div></div>
<div>
<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" target="_blank">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" target="_blank">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" target="_blank">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>
</div>
</div>
</div>
</div>
</body>
</html>