[Mne_analysis] Time-frequency PSD with CWT (morlet wavelet) in a single trial

Denis-Alexander Engemann denis.engemann at gmail.com
Sat Apr 19 06:34:19 EDT 2014
Search archives:

Hi Arno,

let my reply inline,

On Fri, Apr 18, 2014 at 6:55 PM, Arnaud Ferre <arnaud.ferre.pro at gmail.com>wrote:

> Hi all,
> I work on EEG data in behavioral field. I understand the basics of signal
> processing and I’m not so bad in Python. But for a beginner like me,
> MNE-Python is pretty huge. I was advised to use MNE knowing my constraints,
> but I’m starting to think that it’s maybe too evolved for a non-expert
> scientist in this field like me.
>
 I’m just trying to draw a time-frequency PSD from a single trial with a
> CWT (with morlet wavelets). I thought to have found what functions used,
> but in testing my script, I don’t obtain correct result.
>

> In fact, I tested with a simple sinusoid function with a frequency of 10Hz
> on 1sec (1000points). I expected to see a lot of "red blobs" aligned on the
> 10Hz in y-axis but not. I have a continuous and very thin band around 1.5
> Hz and a residual band around the 90Hz. I looked the wavelets and it seems
> fine. What is strange is that I see the correct number of blob, so I think
> it’s not so far of correct result. In first, I thought of a problem in
> adjusting my display, but it seems not.
>

Could you share an example script, e.g. using https://gist.github.com/
That would be very helpful.


>
> I use mainly the function _time_frequency(data, Ws), one of the functions
> in tfr.py in mne.time_frequency where data is a 2D-array containing only my
> signal in data[0].
>
> I read this link:
> http://martinos.org/mne/stable/auto_examples/stats/plot_cluster_1samp_test_time_frequency.html,
> but as I don’t use data with the standard format, it seemed to me
> complicated. Moreover, I think that _time_frequency(data, Ws) is just
> needed to do what I want. And yet, maybe that the specificities of the
> function single_trial_power in tfr.py is the solution…
>
>
>
In fact `single_trial_power` would be the way to go. (
http://martinos.org/mne/dev/generated/mne.time_frequency.single_trial_power.html#mne.time_frequency.single_trial_power
)
In general it's not recommended not use functions starting with underscores
unless you know exactly what you do. Things are much easier once you use
the top-level API. Is your file format that prevents you from doing this?
What kind of EEG  data do you use? We're currently working on improving
support for custom data:

https://github.com/mne-tools/mne-python/issues/1229

Please feel free to participate in the discussion on Github and tell us
more about your use case.


> Thanks in advance
> Arnaud
>
>
I hope we can encourage you to keep exploring the new terrain ;-)

Denis

_______________________________________________
> 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140419/2dce9288/attachment.html 


More information about the Mne_analysis mailing list