# events info on single trial time-frequency epochs

**URL:** <https://mne.discourse.group/t/events-info-on-single-trial-time-frequency-epochs/1184>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 2, 2017, 8:44pm UTC](https://mne.discourse.group/t/events-info-on-single-trial-time-frequency-epochs/1184 "2017-03-02T20:44:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 2, 2017, 8:44pm UTC](https://mne.discourse.group/t/events-info-on-single-trial-time-frequency-epochs/1184/1 "2017-03-02T20:44:53Z")

</div>

Hello,

I want to create single trials time-frequency epochs to later perform time-frequency decoding.  
I am wondering what is the correct way for creating my epochs. I have EEG data with 4 types of events.  
I have been using this code :

tfr = tfr\_morlet(epochs,freqs=freqs, n\_cycles=n\_cycles, use\_fft= True, return\_itc= False, decim=decim, average= False)

But as far as I understood the EpochsTfr object that is returned by tfr\_morlet() does not contain information about the events, is it right?

Is it better then to create an EpochsTfr object for each of my 4 conditions using :

tfr\_cond\_n = tfr\_morlet(epochs[cond\_n],freqs=freqs, n\_cycles=n\_cycles, use\_fft= True, return\_itc= False, decim=decim, average= False)

and then create vectors coding for each trials in each condition - or is there a way to transfer the events information from the original epoch data to the time-frequency data?

I then want to use:

gat.fit(tfr\_epochs, y=tfr\_epochs\_events)

Thanks,  
Claire

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 3, 2017, 8:41am UTC](https://mne.discourse.group/t/events-info-on-single-trial-time-frequency-epochs/1184/2 "2017-03-03T08:41:06Z")

</div>

Hi Claire,

tfr\_cond\_n = tfr\_morlet(epochs[cond\_n],freqs=freqs, n\_cycles=n\_cycles,

> use\_fft= True, return\_itc= False, decim=decim, average= False)

This is the way I would do it. The events information is not stored to the  
EpochsTFR.

-Jaakko

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 3, 2017, 9:57am UTC](https://mne.discourse.group/t/events-info-on-single-trial-time-frequency-epochs/1184/3 "2017-03-03T09:57:45Z")

</div>

Hi Claire,

Jaakko's solution is a possibility (e.g. this is what I used here  
[http://dx.doi.org/10.1016/j.neuron.2016.10.051](http://dx.doi.org/10.1016/j.neuron.2016.10.051)), but this isn't optimal  
because the signal would be rectified at the sensor level.

You'd ideally need to work with covariance matrices based on signals  
filtered at particular frequencies. I'm hoping to have the time to add a  
tutorial and a set a functions in the next couple of weeks.

Best,

Jean-R?mi

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 3, 2017, 11:29am UTC](https://mne.discourse.group/t/events-info-on-single-trial-time-frequency-epochs/1184/4 "2017-03-03T11:29:16Z")

</div>

Hi,

Thanks Jaakko and Jean-R?mi for your responses.  
I'll try to make my way through it and will be looking forward for a tutorial !

Best,  
Claire

Le 03. 03. 17 ? 09:57, JR KING a ?crit :
