[FieldTrip] Time-frequency analysis with Morlet wavelets

daniel.strahnen at uni-ulm.de daniel.strahnen at uni-ulm.de
Thu Aug 20 11:48:30 CEST 2020


Dear Christine,

 

Thanks a lot for your response! I added some data before and after the data
of interest and it looks good now.

 

Best wishes

Daniel

 

Von: fieldtrip <fieldtrip-bounces at science.ru.nl> Im Auftrag von Blume
Christine
Gesendet: 18 August 2020 21:06
An: FieldTrip discussion list <fieldtrip at science.ru.nl>
Betreff: Re: [FieldTrip] Time-frequency analysis with Morlet wavelets

 

Hi Daniel,

 

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
width/F/pi, 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.

 

Best,

Christine

 

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.  

 

Von: fieldtrip <fieldtrip-bounces at science.ru.nl
<mailto:fieldtrip-bounces at science.ru.nl> > Im Auftrag von
daniel.strahnen at uni-ulm.de <mailto:daniel.strahnen at uni-ulm.de> 
Gesendet: Dienstag, 18. August 2020 19:12
An: 'FieldTrip discussion list' <fieldtrip at science.ru.nl
<mailto:fieldtrip at science.ru.nl> >
Betreff: [FieldTrip] Time-frequency analysis with Morlet wavelets

 

Dear FieldTrip-Community,

 

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.

In general the results seem plausible since I would expect the prominent
5-10Hz power.

The sampling rate of my data is 1kHz and it contains 30 trials with a length
of 3s each.

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?

        cfg              = [];

        cfg.output       = 'pow';

        cfg.channel      = 'all';

        cfg.method       = 'wavelet';

        cfg.foi          = 1:1:48;                        

        cfg.t_ftimwin    = 20./cfg.foi; 

        cfg.toi          = 1:0.001:4;                     

        cfg.width      = 3;

        freq_data = ft_freqanalysis(cfg, data);

 



 

Thank you very much and best regards

 

Daniel

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200820/cec545ee/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 11979 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200820/cec545ee/attachment.jpg>


More information about the fieldtrip mailing list