TFRs: optimal overlap in time and frequency

97 views
Skip to first unread message

Gabriel Obregon-Henao

unread,
Aug 20, 2019, 3:00:57 AM8/20/19
to AnalyzingNeuralTimeSeriesData
Hello Dr. Cohen,

I've read several chapters of your book multiple times, and I must say I learn something new in every iteration. We call it "The Bible" in our lab (hopefully this doesn't offend anyone; it got The Beatles in trouble after all), and we've been waiting for a new edition for a long time.

I was wondering if there's an optimal way of choosing the percentage of overlap in both time and frequency for the short-time Fourier transform, the Multitaper method, and the Morlet Wavelet decomposition. I remember reading somewhere that for certain windowing functions one doesn't gain much (if anything) beyond a 50% overlap, but I haven't been able to find the reference. I work with iEEG recordings and I've been thinking about a principled way of downsampling my data in these two dimensions before running statistical tests between different experimental conditions. 

Thanks!

--Gabriel 

Mike X Cohen

unread,
Aug 20, 2019, 7:17:27 AM8/20/19
to analyzingneura...@googlegroups.com
Thank you, Gabriel, for your kind words. There is no second edition in the pipeline, as this is the publisher's decision, not mine. However, I do have a supplemental online course that goes a bit beyond the book. You (and anyone else) can use the link below to access it for free (coupon will expire at the end of August).

As for your question, post-analysis down sampling is a good idea. You can do this with wavelet convolution, which I talk about that in the book somewhere, and you can also check out this youtube video. And you can do it with the STFFT using overlapping windows. I don't think there is an optimal way to choose this parameter -- I typically set it up so that the resulting TF map has a temporal resolution of around 40 Hz.

Mike


--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/analyzingneuraltimeseriesdata/e1138976-6abd-47cd-81fd-f3e5f7f5f90a%40googlegroups.com.

Gabriel Obregon-Henao

unread,
Aug 20, 2019, 1:13:26 PM8/20/19
to AnalyzingNeuralTimeSeriesData
Thanks Mike,
I had watched your lecture before and the way I’m doing it, as of now, is that I temporally-downsample the Morlet Wavelet decomposition such that there’s a 50% overlap between windows at my highest frequency (200 Hz). I’m using Fieldtrip and I compute the effective length of the temporal windows, at each frequency, as tw = cfg.gwidth * (cfg.width ./ pi * cfg.foi). I’m not sure if this is the non-empirical way of computing the FWHM that you vouch for in your 2018 paper, and that’s something else I’ll have to look into as I’m currently defining my wavelets based on number of cycles. For the effective width of the spectral window, at each frequency, I use fw = 2 * cfg.foi ./ cfg.width, and in theory I could choose the center frequencies such that there’s a given percent of overlap between the spectral windows. As of now, I choose an arbitrary number of wavelets to cover my entire frequency range (2 - 200 Hz), and that was the point I was trying to bring up with “downsampling” in the frequency dimension (i.e., is there an optimal way of choosing the number of wavelets, and if so, is it based on percentage of overlap?). If I define the center frequencies in logspace, I get multiple frequencies in the lower frequency ranges (e.g., if I use 90 wavelets to tile the entire frequency range, I get 8 frequencies between 2 and 3 Hz), and I think this might be affecting the sensitivity of my statistical tests. I’ve been thinking on splitting my analyses in 2, and computing the spectral decomposition via wavelets or the STFT for frequencies between 2 - 30 Hz, and using multitaper for frequencies between 30 - 200 Hz. Could you please remind me how the center frequencies are defined by default for the STFT and the Multitaper method? Is it based on the number of samples of the entire signal?

Thanks,

-Gabriel

Mike X Cohen

unread,
Aug 21, 2019, 1:22:46 AM8/21/19
to analyzingneura...@googlegroups.com
See below...

On Tue, Aug 20, 2019 at 7:13 PM Gabriel Obregon-Henao <gabrielobr...@gmail.com> wrote:
Thanks Mike,
I had watched your lecture before and the way I’m doing it, as of now, is that I temporally-downsample the Morlet Wavelet decomposition such that there’s a 50% overlap between windows at my highest frequency (200 Hz). I’m using Fieldtrip and I compute the effective length of the temporal windows, at each frequency, as tw = cfg.gwidth * (cfg.width ./ pi * cfg.foi). I’m not sure if this is the non-empirical way of computing the FWHM that you vouch for in your 2018 paper, and that’s something else I’ll have to look into as I’m currently defining my wavelets based on number of cycles.

I generally recommend computing these temporal/spectral widths empirically (based on the actual wavelet) rather than analytically, because the two answers can diverge depending on the sampling rate and frequency, and the empirical calculation will be more accurate. Nonetheless, the analytic approach is also fine in most cases.

 
For the effective width of the spectral window, at each frequency, I use fw = 2 * cfg.foi ./ cfg.width, and in theory I could choose the center frequencies such that there’s a given percent of overlap between the spectral windows. As of now, I choose an arbitrary number of wavelets to cover my entire frequency range (2 - 200 Hz), and that was the point I was trying to bring up with “downsampling” in the frequency dimension (i.e., is there an optimal way of choosing the number of wavelets, and if so, is it based on percentage of overlap?).

Honestly, I think you are over-thinking the issue a bit. There is spectral autocorrelation in the brain (non-stationarities and so forth) and additional smoothness imposed by the wavelets. If the results matrices are starting to take up too much memory, then just use fewer frequencies. I don't think there is an analytic way of having the optimal number of frequencies, as this depends on the data. For example, if all of the relevant activity is below 15 Hz, then the "optimal" number of frequencies above 15 Hz is zero.
 
 
If I define the center frequencies in logspace, I get multiple frequencies in the lower frequency ranges (e.g., if I use 90 wavelets to tile the entire frequency range, I get 8 frequencies between 2 and 3 Hz), and I think this might be affecting the sensitivity of my statistical tests.

It won't really affect the statistics. If you are doing stats by defining TF windows (what I call "approach 2" in the book), then the resolution doesn't matter. If you are using map-wise permutation testing, then having a higher frequency resolution means the clusters will be bigger, but they will also be bigger in the shuffled maps.
  
 
I’ve been thinking on splitting my analyses in 2, and computing the spectral decomposition via wavelets or the STFT for frequencies between 2 - 30 Hz, and using multitaper for frequencies between 30 - 200 Hz. Could you please remind me how the center frequencies are defined by default for the STFT and the Multitaper method? Is it based on the number of samples of the entire signal?


In the FFT, the frequencies go from 0 to Nyquist in N/2+1 steps. So therefore the spectral resolution is defined by the number of time points in the time window (not the entire signal). If you want to increase the resolution, you can zero-pad. If you expect gamma or high-frequency activity and expect it to be bursty, then multitaper is definitely something to consider. Keep in mind that it will smooth the results, so the ultimate temporal precision will be lower than that of wavelet convolution. 

 
Thanks,

-Gabriel


--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.

Gabriel Obregon-Henao

unread,
Aug 21, 2019, 3:10:43 AM8/21/19
to AnalyzingNeuralTimeSeriesData
Thanks for the comprehensive answers to my questions. I agree that I'm probably overthinking the issue, and it's most likely due to a lack of understanding. I'll check "approach 2" in the book, as I've only watched your YouTube videos on statistical testing, and I don't recall learning about the TF windows. I've been playing around with cluster-based permutation tests and FDR correction methods, and I've ran into a couple of sensitivity issues when applying them to iEEG data (but that's a topic for a different discussion).

Best,

--Gabriel  

Gabriel Obregon-Henao

unread,
Aug 22, 2019, 2:32:44 PM8/22/19
to AnalyzingNeuralTimeSeriesData
Hi Mike,

I've been reading the chapters of the book on statistical analyses, and I was wondering if you could please expand a little bit on the following:

"This heterogeneity, which affects cluster sizes, is not taken into account during cluster correction. However, adjusting the balance between temporal and frequency precision as a function of frequency during time-frequency decomposition will help minimize the heterogeneity of autocorrelation over frequencies".

What would be a good strategy for optimizing this balance? Would it entail increasing smoothing in both time and frequency as a function of frequency?

Thanks,

--Gabriel
See below...

To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.

Mike X Cohen

unread,
Aug 23, 2019, 9:51:56 AM8/23/19
to analyzingneura...@googlegroups.com
For wavelet convolution, you can increase the number of cycles as the frequencies increase. That will adjust the smoothing. However, that doesn't entire solve the "problem" that cluster correction is generally biased towards lower frequencies because lower-frequency activity tends to be more extended in time and frequency. 

Another possible solution is to use cluster "mass" instead of cluster size. Mass is defined as the sum of all the test-statistic values inside each cluster. This allows smaller-but-stronger clusters to remain significant. It might be worth trying, although in my experience, cluster mass and cluster size tend to give roughly the same thresholds. 

Mike



See below...

To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.


--
Mike X Cohen, PhD
Fresh look: mikexcohen.com

--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/analyzingneuraltimeseriesdata/598f33f0-dd67-4abc-ae8d-a197fe6c0f91%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages