<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.nb
        {mso-style-name:nb;}
span.p
        {mso-style-name:p;}
span.n
        {mso-style-name:n;}
span.E-MailFormatvorlage23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Dear Christine,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks a lot for your response! I added some data before and after the data of interest and it looks good now.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best wishes<o:p></o:p></p><p class=MsoNormal>Daniel<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:EN-GB'>Von:</span></b><span lang=DE style='mso-fareast-language:EN-GB'> fieldtrip <fieldtrip-bounces@science.ru.nl> <b>Im Auftrag von </b>Blume Christine<br><b>Gesendet:</b> 18 August 2020 21:06<br><b>An:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br><b>Betreff:</b> Re: [FieldTrip] Time-frequency analysis with Morlet wavelets<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=DE>Hi Daniel,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal>This shows that the wavelets are too long compared to your segment length at lower frequencies. Generally, you should thus choose segments that are long enough and thus contain enough data before the first time point of interest and after the last time point of interest. You can calculate the width of the wavelet for the lowest frequency of interest with the formula <span class=nb><span style='font-size:10.0pt;font-family:"Courier New"'>width</span></span><span class=p><span style='font-size:10.0pt;font-family:"Courier New"'>/</span></span><span class=n><span style='font-size:10.0pt;font-family:"Courier New"'>F</span></span><span class=p><span style='font-size:10.0pt;font-family:"Courier New"'>/</span></span><span class=nb><span style='font-size:10.0pt;font-family:"Courier New"'>pi</span></span>, where the width is the width of the wavelet and F is the frequency. You should add at least half the width of the wavelet to the data before the first data point of interest.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best,<o:p></o:p></p><p class=MsoNormal>Christine<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>PS: Although there are probably other opinions, for analyses between 1 and 20Hz I usually choose a width of 3 as you did here too.  <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='mso-fareast-language:DE'>Von:</span></b><span lang=DE style='mso-fareast-language:DE'> fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>> <b>Im Auftrag von </b><a href="mailto:daniel.strahnen@uni-ulm.de">daniel.strahnen@uni-ulm.de</a><br><b>Gesendet:</b> Dienstag, 18. August 2020 19:12<br><b>An:</b> 'FieldTrip discussion list' <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br><b>Betreff:</b> [FieldTrip] Time-frequency analysis with Morlet wavelets<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE>Dear FieldTrip-Community,<o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal>I am trying to implement the time-frequency analysis tutorial onto my own data, however I am encountering the edge effects in the figure below.<o:p></o:p></p><p class=MsoNormal>In general the results seem plausible since I would expect the prominent 5-10Hz power.<o:p></o:p></p><p class=MsoNormal>The sampling rate of my data is 1kHz and it contains 30 trials with a length of 3s each.<o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>The code I used is posted below. Does anyone have an idea on how to get a good spectrogram in the time edges in the beginning and in the end of the trials?<o:p></o:p></p><p class=MsoNormal>        cfg              = [];<o:p></o:p></p><p class=MsoNormal>        cfg.output       = 'pow';<o:p></o:p></p><p class=MsoNormal>        cfg.channel      = 'all';<o:p></o:p></p><p class=MsoNormal>        cfg.method       = 'wavelet';<o:p></o:p></p><p class=MsoNormal>        cfg.foi          = 1:1:48;                        <o:p></o:p></p><p class=MsoNormal>        cfg.t_ftimwin    = 20./cfg.foi; <o:p></o:p></p><p class=MsoNormal>        cfg.toi          = 1:0.001:4;                     <o:p></o:p></p><p class=MsoNormal>        cfg.width      = 3;<o:p></o:p></p><p class=MsoNormal>        freq_data = ft_freqanalysis(cfg, data);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><img border=0 width=467 height=361 style='width:4.8645in;height:3.7604in' id="Grafik_x0020_1" src="cid:image001.jpg@01D676E7.D2D07C90" alt="Ein Bild, das Computer enthält. Automatisch generierte Beschreibung"><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thank you very much and best regards<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Daniel<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>