<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div apple-content-edited="true">Dear Jinyi,
</div><div apple-content-edited="true">what you’re referring to is time-frequency analysis. From your e-mail I assumed that you’ve already performed frequency analysis, yet apparently not. You can compute the power spectrum bei using something like this:</div><div apple-content-edited="true"><br></div><div apple-content-edited="true"><pre class="code">cfg = [];
cfg.output = 'pow';
cfg.method = 'mtmfft';
cfg.taper = 'dpss';
cfg.foilim = [1 20];
cfg.tapsmofrq = 2;
fft_data= ft_freqanalysis(cfg,data);</pre><div>Subsequently you can plot fft_data with the functions I mentioned in my previous e-mail.</div><div>Note that we have also a video lectures section where you can get some detailed insight into frequency domain analysis. Please have a look here:</div><div><a href="http://fieldtrip.fcdonders.nl/video">http://fieldtrip.fcdonders.nl/video</a></div><div>and also here</div><div><a href="https://www.youtube.com/watch?v=QLvsa1r1Voc">https://www.youtube.com/watch?v=QLvsa1r1Voc</a></div></div>
<div><br></div><div><br></div><div>best</div><div>tzvetan</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><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><div> <br class="webkit-block-placeholder"></div><font face="Times New Roman" size="3">
</font><div 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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-family: 'Courier New'; font-size: 10pt;">cfg<span> </span>= [];</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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="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></div><font face="Times New Roman" size="3">
</font><div 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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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="font-family: 'Courier New'; font-size: 10pt;">;</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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="font-family: 'Courier New'; font-size: 10pt;">;</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-family: 'Courier New'; font-size: 10pt;">TFRhann = ft_freqanalysis(cfg,
data);</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div 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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-family: 'Courier New'; font-size: 10pt;">cfg = [];</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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="font-family: 'Courier New'; font-size: 10pt;">;<span> </span></span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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="font-family: 'Courier New'; font-size: 10pt;">;<span> </span></span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="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="font-family: 'Courier New'; font-size: 10pt;">;</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-family: 'Courier New'; font-size: 10pt;">figure </span></div><font face="Times New Roman" size="3">
</font><div style="margin: 0in 0in 0pt; line-height: normal;"><span style="font-family: 'Courier New'; font-size: 10pt;">ft_singleplotER(cfg, TFRhann)</span><span style="font-family:"Courier New";font-size:12pt"></span></div><font 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>
_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br></body></html>