[FieldTrip] best parameters for wavelet convolution.

mubeen afzal mubafzal at hotmail.com
Thu Feb 18 23:13:26 CET 2021


Hi Stephen,

That is great Stephen. Thanks for the tips, helpful advises and guidelines. I will go through the links and watch the videos

My project is basically a group of generalized epilepsy patients and trying to study their outcomes. One of the variables I am planning to look at is PSD of the epileptiform discharges but it turns out to be abit more trickier given the variability in duration of the spike/waves in each patients, visual variety of the signal during discharge, different noise levels, different burden of spike/wave in a standard routine EEG and the many methods and toolboxes out there e.t.c. So ideally am aiming for standardized way where I can end up extracting accurately a mean single value frequency of the spike/wave discharges for each patient (probably the slow frequency components of the discharge) and a mean spectral power of those (most importantly the method is standardized for all patients for eventual stat comparisons between cases and controls). At this stage I am trying different things but finding a reference as to what would be best.  I am using default parameters in the various toolboxes but dont know if they are the best for my project. This is summary of one of the variable for the project.

Regards,
Mubeen


________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
Sent: Thursday, February 18, 2021 9:59 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] best parameters for wavelet convolution.

Dear Mubeen,

1) My short answer would be:

a) There are very good "Fieldtip Lectures" on the topic that addresses questions of frequency resolution and time-windows in general and which would be a good place to start.
There are several people presenting nearly the same slides, so you can take a pick based on flavour, e.g.:
https://www.youtube.com/watch?v=QLvsa1r1Voc<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQLvsa1r1Voc&data=04%7C01%7C%7Ca99c76b4039b4019b01508d8d3de8d7d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637492300122594032%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=gMqhkirYC00d1rIKYg4OMVnR6W5tAJSswe6faRmvTpE%3D&reserved=0>
https://www.youtube.com/watch?v=vwPpSglPJTE<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvwPpSglPJTE&data=04%7C01%7C%7Ca99c76b4039b4019b01508d8d3de8d7d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637492300122604024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=18jOdjrm9yB5Q1yOQKnj%2F6NSoNvUWAU4XMa19lYiXvk%3D&reserved=0>
https://www.youtube.com/watch?v=dHTuzMsjVJA<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdHTuzMsjVJA&data=04%7C01%7C%7Ca99c76b4039b4019b01508d8d3de8d7d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637492300122604024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ifrp57mVWxsQAL%2FG5NsLEPJLVDBLiQNmPw6HYxzWBDk%3D&reserved=0>

b) If you really want to estimate power changes *over time*, using wavelets is one way, and using tapered sliding time-windows using FFT is another ('cfg.method = 'mtmconvol'). The latter allows you even more freedom in how much you want to smooth over frequencies (see lectures for explanation of "multi tapering").

d) Your question suggests, however, that you would like to capture the 1-4Hz peaks in SWDs *averaged over time*. For this you would not necessarily need a time-resolved frequency estimate, right? E..g. an averaged FFT done on each segment might suffice and be more to the point. Wavelets do not come into play then. Correct me if I'm wrong! Perhaps doing a peak detection on the spikes - and calculating the inter-spike intervals - might be another approach.

c) If you are set on doing a time-resolved spectral analysis, then you will probably be able to see broad-band high-frequency power associated with the SWD peaks. However, to accurately estimate power at lower frequencies, especially as low as 1Hz, you might need time-widows of over a second (e.g. 3 seconds if you want to base it on 3 cycles of 1Hz, which would be a bare minimum). So you might not be able to resolve those low frequencies over time. Again, I think the lecture might clarify this point, and I am not sure you are asking for time-resolved analysis.

d) Feel free to experiment with different parameters, this will give you a sense of the data and limits of frequency analyses, and the effect of certain parameters. In the end it also depends on how stationary the spectral content of the signal is, which is sometimes hard to determine a-priori.

e) Wavelets can be easily used in a way that creates far more data than necessary, e.g. by resolving at every sample, instead of in e.g. steps of tens of milliseconds. So you might want to keep memory usage and CPU time in mind. A bit of experimentation might help you set parameters that are "good enough" but don't overload your computer's resources.

2a) Baseline normalization of the timecourses is a good idea before frequency analysis:
https://www.fieldtriptoolbox.org/faq/why_does_my_tfr_look_strange/<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fwhy_does_my_tfr_look_strange%2F&data=04%7C01%7C%7Ca99c76b4039b4019b01508d8d3de8d7d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637492300122604024%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jDaHyILSjGk%2Bm0FGZ2dIC2hCh3dXDyTilymwO0A5Rc0%3D&reserved=0>

2b) Baseline normalization of the time-resolved power estimates can only be done after doing the spectral estimates, right? If/when depends on the reason you want to do so though. For exploring and plotting, note that you can do it 'on the fly' in FieldTrip's plotting functions.

Anyway, that's the 'short' answer. I might be able to say more if I know more about the goal of the frequency analysis of PWDs (with which I am somewhat familiar). And check the videos!

Happy fieldtripping,
Stephen


Op do 18 feb. 2021 om 07:10 schreef mubeen afzal <mubafzal at hotmail.com<mailto:mubafzal at hotmail.com>>:
Hi all,

I am aiming to calculate average spectral values for segment of EEG containing spike/wave discharges in patients which can last anywhere between 0.5 seconds to 6 seconds. I am planning on morlet wavelet convolution but am unsure what the best parameters would be in terms of width/cycles/timewin of the morlet configurations. Typically these spike/waves on visual inspection are anywhere between 1hz to more commonly between 3-4 Hz or less often 5 hz frequency discharges.


  1.  What would be the best parameters for a wavelet convolution?

 2. is baseline normalization usually done before spectral analysis or can it be done after?


Any help would be highly appreciated.

Regards,
Mubeen J
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=04%7C01%7C%7Ca99c76b4039b4019b01508d8d3de8d7d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637492300122614021%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8otdqQyPbfmub8lSukcvvp%2BOY3e0QVtCd3Lh%2BueoyeM%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=04%7C01%7C%7Ca99c76b4039b4019b01508d8d3de8d7d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637492300122614021%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8vqE8vg4gvFZxWRwuHxg%2BE0o5a0RyDzN%2FlzfTRPH2Ic%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210218/77c4019b/attachment.htm>


More information about the fieldtrip mailing list