[Mne_analysis] Temporal Resolution in Time-Frequency Analysis

Phillip Alday phillip.alday at mpi.nl
Wed Oct 2 16:24:00 EDT 2019
Search archives:

        External Email - Use Caution        

On 02/10/2019 21:21, Maryam Zolfaghar wrote:
> Hi Phillip, 
> Thank you for the information.
> 1. During the band-pass filter before applying Hilbert, some level of
> smoothing happens. That is why I want to know my exact temporal
> resolution to report in the paper. In MNE examples, I saw the code
> "w_size = n_cycles / ((fmax + fmin) / 2.) # in seconds
> <https://mne.tools/dev/auto_examples/decoding/plot_decoding_csp_timefreq.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-timefreq-py>"
> to calculate the infer window size but I am not sure whether this is
> the way to calculate the temporal resolution according to the number
> of cycles and the frequency of interests (fmin, fmax).

That example doesn't use the HIlbert transform .... and that example
chunks the data up into windows, but wants the same number of cycles,
regardless of frequency band, in each window and so has to have
variable-length windows.

So that's not related to the filtering per se. The number of complete
oscillatory cycles for a given frequency f is dependent on the length of
the time window. This is the fundamental trade-off. For the example,
they just take the middle/average frequency of a given frequency bracket.

The Hilbert transformation preserves the temporal resolution of the
phase information at the cost of the frequency resolution: the Hilbert
transform 'averages' across all the frequencies present in the signal
and gives a single phase value for that. So the work-around is filtering
in advance, which is where the time-frequency tradeoff comes out ....

> 2. Thanks for the links. However, my question was more about the way
> they implement the filter in eegfilt routine in MATLAB (a two-way
> least-square FIR filter with maximally steep roll-offs and an
> extremely narrow transition band).

Again, look at the documentation for full details about how the
different filter options are implemented in MNE and how to specify the
design you want.

It's been a long time since I've done any analysis in MATLAB, but I
suspect eegfilt isn't a MATLAB-builtin but rather implemented in EEGLAB,
ERPLAB or FieldTrip. Specifying that is more relevant than MATLAB --
that would be like asking about Python's "Epochs" object. ;) I know e.g.
that there were some problems with EEGLAB's old FIR filters that have
largely been addressed.

For a good comparison of the different packages back (at least as they
were in 2015 and unfortunately not including MNE), see

Widmann, A.; Schröger, E. & Maess, B. Digital filter design for
electrophysiological data – a practical approach  Journal of
Neuroscience Methods, Cutting-edge EEG Methods, 2015 , 250 , 34-46

(but again see the current documentation for the most up-to-date info)

That paper is also a nice introduction to filtering in a way that's
quire relevant for your question. The narrow transition band will you
longer filters, which will in some sense decrease your temporal
resolution in a way that's you can perhaps best summarize with the
impulse response function.



> I would be thankful if you could help me with the above questions.
> Thanks,
> -Mary
> On Tue, Oct 1, 2019 at 3:26 PM Phillip Alday <phillip.alday at mpi.nl
> <mailto:phillip.alday at mpi.nl>> wrote:
>     The advantage to the Hilbert transform is that it more or less
>     preserves the original temporal resolution but completely loses
>     any frequency resolution (hence the need to filter beforehand,
>     which does in a certain sense impact temporal resolution).
>     Regarding your second question, a quick search yields a number of
>     results:
>     https://mne.tools/stable/search.html?q=filter&check_keywords=yes&area=default
>     but especially
>     https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.filter
>     https://mne.tools/stable/auto_tutorials/preprocessing/plot_30_filtering_resampling.html
>     Phillip
>     On 01/10/2019 23:07, Maryam Zolfaghar wrote:
>>             External Email - Use Caution        
>>     Hi all, 
>>     I am analyzing my EEG signals through time-frequency methods and
>>     interested in the pre-stimulus alpha and theta band activity. The
>>     time resolution is important for my analysis. I have two very
>>     basic questions:
>>                 1.  I am wondering if there is any way to calculate
>>     the temporal precision/resolution after applying the
>>     Hilbert transform to get the power? 
>>                 2. Also, is there any function similar to *eegfilt*
>>     in Matlab in MNE? 
>>     Thank you, 
>>     -Mary
>>     _______________________________________________
>>     Mne_analysis mailing list
>>     Mne_analysis at nmr.mgh.harvard.edu <mailto:Mne_analysis at nmr.mgh.harvard.edu>
>>     https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191002/cee07498/attachment-0001.html 

More information about the Mne_analysis mailing list