[FieldTrip] Time-frequency analysis with Morlet wavelets

Blume Christine christine.blume at sbg.ac.at
Tue Aug 18 21:05:50 CEST 2020


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> Im Auftrag von daniel.strahnen at uni-ulm.de
Gesendet: Dienstag, 18. August 2020 19:12
An: 'FieldTrip discussion list' <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);

[Ein Bild, das Computer enth?lt.  Automatisch generierte Beschreibung]

Thank you very much and best regards

Daniel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200818/2349146b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 11979 bytes
Desc: image003.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200818/2349146b/attachment.jpg>


More information about the fieldtrip mailing list