# To extract conti-time-frequency transformations from preprocessed data

**URL:** <https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744>\
**Category:** Support & Discussions\
**Tags:** preprocessing\
**Created:** [April 21, 2022, 3:46am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744 "2022-04-21T03:46:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhD-GOAT](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/phd-goat/32/1326_2.png) [@PhD-GOAT](https://mne.discourse.group/u/PhD-GOAT)\
**Post date:** [April 21, 2022, 3:46am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/1 "2022-04-21T03:46:20Z")

</div>

- MNE version: 1.0.1
- operating system: Windows 10

Is there a guideline for how data pre-processed in mne is time-frequency transformation and how it is extracted?

![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/8/8c21f0b8615574563dbd352eeaf65e87ed851c84.png)

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 21, 2022, 7:22am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/2 "2022-04-21T07:22:36Z")

</div>

Hello @PhD-GOAT, could you please elaborate what exactly you want to do? I’m not sure I fully understand from your posting. Thanks!

---

<div class="post-metadata">

**Author:** ![PhD-GOAT](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/phd-goat/32/1326_2.png) [@PhD-GOAT](https://mne.discourse.group/u/PhD-GOAT)\
**Post date:** [April 21, 2022, 7:30am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/3 "2022-04-21T07:30:43Z")

</div>

hi!! @richard

I want to preprocess raw data and extract preprocessing data for machine learning. It was confirmed that only the morlet calculation method exists in mne. But here, I wonder how to convert the time frequency and how to extract it. I am thinking about putting this into a train and test for machine learning.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 21, 2022, 10:01am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/4 "2022-04-21T10:01:12Z")

</div>

I have to admit I’m still unsure where your problem / question arises. Could you please share some code that demonstrates what you’ve done so far and where you’re now stuck?

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![PhD-GOAT](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/phd-goat/32/1326_2.png) [@PhD-GOAT](https://mne.discourse.group/u/PhD-GOAT)\
**Post date:** [April 22, 2022, 12:33am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/5 "2022-04-22T00:33:13Z")

</div>

Now I’m at the stage of thinking about how to code. First, the PSG EDF is converted into a wav file for each signal for convenience of use. The converted wav file is then divided into 30-second intervals, which is the sleep stage reading cycle, and classified by reading result file provided with the data. Finally, the divided files are made into spectrogram images of wav files, and the brain waves are used as band-pass filters to extract characteristics by band.

---

<div class="post-metadata">

**Author:** ![balandongiv](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/balandongiv/32/104_2.png) [@balandongiv](https://mne.discourse.group/u/balandongiv)\
**Post date:** [April 22, 2022, 7:06am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/6 "2022-04-22T07:06:43Z")

</div>

You can connsider [mne-feature](https://github.com/mne-tools/mne-features) to design an efficient ML. Have a look at this accompanying [tutorial](https://mne.tools/mne-features/auto_examples/plot_seizure_example.html#sphx-glr-auto-examples-plot-seizure-example-py)

---

<div class="post-metadata">

**Author:** ![PhD-GOAT](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/phd-goat/32/1326_2.png) [@PhD-GOAT](https://mne.discourse.group/u/PhD-GOAT)\
**Post date:** [April 22, 2022, 8:11am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/7 "2022-04-22T08:11:15Z")

</div>

good, but cloning that git and run examples

—\> 65 paths = download\_bonn\_ieeg(’./bonn\_data’)  
print error: BadZipFile: File is not a zip file

at [plot\_mne\_sample\_features.py](https://github.com/mne-tools/mne-features/blob/master/examples/plot_mne_sample_features.py)

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 22, 2022, 9:11am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/8 "2022-04-22T09:11:58Z")

</div>

Yay, yet another approach to sleep stage classification 😅😅😅

You may also want to consider @cbrnr’s [SleepECG](https://sleepecg.readthedocs.io/), or [YASA](https://raphaelvallat.com/yasa/), or visbrain’s [Sleep](http://visbrain.org/sleep.html).

---

<div class="post-metadata">

**Author:** ![cbrnr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cbrnr/32/1409_2.png) [@cbrnr](https://mne.discourse.group/u/cbrnr)\
**Post date:** [April 22, 2022, 9:53am UTC](https://mne.discourse.group/t/to-extract-conti-time-frequency-transformations-from-preprocessed-data/4744/9 "2022-04-22T09:53:44Z")

</div>

> [@richard](#):
>
> You may also want to consider @cbrnr’s [SleepECG](https://sleepecg.readthedocs.io/), or [YASA](https://raphaelvallat.com/yasa/), or visbrain’s [Sleep](http://visbrain.org/sleep.html).

Thanks for the shoutout, I just wanted to clarify that SleepECG is intended for ECG data only (no EEG).
