Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Class to filter EEG artifacts using WPT, ICA and EMD

NotificationsYou must be signed in to change notification settings

efsierraa/Pywptemd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python 3.9Poetry

A class used to remove artifacts from EEG signals, the default EEG signal has a duration of 6 seconds and 19 channels.

How to use it:

Inputs:

EEG data with artifacts to be filtered, and EEG data in resting state, dimensions N x channels where N is the length of an EEG record

Methods

_wpt_filter: filters data selecting the most corrupt node in a wpt removes it and makes the reconstruction of the signal, a wpt is computed per channel

wptemd_filter: applies _wpt_filter, and after decomposing each filtered channel into imfs using emd, to filter again the signal removing the most corrupt imf computing J a criterion based on entropy and std normalized with respect to the resting data

wptica_filter: like in wptemd_filter applies _wpt_filter to filter the data, afterward a second ICA based filter is applied where is removed the most contaminated ICA component, and reconstructed the sources

Output

Data_filtered a filtered version of the original EEG data

Example

importnumpyasnpfromPywptemd.wptemdimportwptemdfs=500data=np.random.randn(19,6*fs)data_rest=np.random.randn(19,6*fs)*.25parameters= {'wavelet':'dmey','maxlevel':7,# wavelet parameters'imf_opts':{'stop_method':'rilling','rilling_thresh':(0.05,0.5,0.05)},# emd parameters'w':0.5,# emd selection criterion J parameter'n_components':19}# ICA parameterfilter=wptemd(**parameters)wpt_filtered=filter._wpt_filter(data)print(wpt_filtered.shape)data_filtered_wptemd=filter.wptemd_filter(data,data_rest)print(data_filtered_wptemd.shape)data_filtered_wtpica=filter.wptica_filter(data)print(data_filtered_wtpica.shape)

References

[1] Bono, V., Das, S., Jamal, W., & Maharatna, K. (2016). Hybrid wavelet and EMD/ICA approach for artifact suppression in pervasive EEG. Journal of neuroscience methods, 267, 89-107.

About

Class to filter EEG artifacts using WPT, ICA and EMD

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp