如何将离散小波变换应用于脑电信号?

2024-05-13 17:34:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我有EEG睡眠数据集,在选择一名患者后,我开始应用一些预处理,以便对原始数据应用dwt,我删除了一些通道(eogemgecg),因为我只需要eeg通道(fpz-czpz-oz);我提取了注释和事件,当我想对我的原始数据应用离散小波变换时,我得到了错误:

import mne
from mne.datasets.sleep_physionet.age import fetch_data
from mne.time_frequency import psd_welch
import numpy as np
import matplotlib.pyplot as plt
import pywt

[a] =fetch_data(subjects=[1],recording=[1])
raw = mne.io.read_raw_edf(a[0])
annotation=mne.read_annotations(a[1])
raw.set_annotations(annotation,emit_warning=False)
new_order = ['EEG Fpz-Cz']
raw = raw.copy().reorder_channels(new_order)
print(raw.ch_names)
raw.plot(duration=60)
waveletname='sym5'
coeff = pywt.wavedec(raw, waveletname, level = 6)

error : All picks must be < n_channels (1), got 1

多谢各位


Tags: fromimportnewreaddata原始数据rawas