[Mne_analysis] Hilbert Transform for Time Frequency Analysis (Aditya P Singh)

Phillip Alday phillip.alday at mpi.nl
Tue Jul 25 06:57:22 EDT 2017
Search archives:

You need an extra dimension if you want to use the amplitude at all
times and channels:

amplitude = np.zeros((n_chans, n_freqs, n_times)):

h = raw_filter.apply_hilbert(picks,envelope = True)
a = raw_filter.apply_function(np.abs, picks)

...

amplitude[:,freq_idx,:] = a._data[picks]

Phillip

On 07/07/2017 09:21 AM, Aditya P Singh wrote:
> Hi all, 
> 
> Thank you Philip for the help, and I used the loop example but I am not
> exactly sure how to save the amplitude values for each frequency and
> time window in the code. I have attached some of my code as a .py file
> but I think just looking at the example:
> 
> tf_scores[freq, t] = np.mean(cross_val_score(estimator=clf, X=X, y=y,                                               scoring='roc_auc', cv=cv, n_jobs=1), axis=0)
> 
> And it is initialized as:
> 
> tf_scores = np.zeros((n_freqs - 1, n_windows))
> 
> which I changed the tf_scores to the amplitude by applying the hilbert
> transform then drawing out the amplitude
> 
>  h = raw_filter.apply_hilbert(picks,envelope = True)
>  a = raw_filter.apply_function(np.abs, picks)
> 
> So instead of tf_scores, it would be
> 
>  amplitude[freq, t] = [a._data[picks[0]]]
> 
> But here is where I am having the trouble since I am not not sure how to
> save the sequence of amplitudes over time for each frequency band in the
> loop? I am sure it is a simple fix, but I am just not sure how to do it.
> Also what should I be setting my vmin as in the tfr plot? I have
> attached my code for further detail.
> 
> 
> Thanks,
> 
> Aditya
> 
> 
> 
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 
> 
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the e-mail
> contains patient information, please contact the Partners Compliance HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in error
> but does not contain patient information, please contact the sender and properly
> dispose of the e-mail.
> 


More information about the Mne_analysis mailing list