Data preprocessing
Assume a 6-channel EEG (4-channel eeg+2 channel EOG) that generates Ndarray or matrix S,row for time Point,col as a channel. To standardize S:
S/= s.std (axis=0)
ICA analysis
Module Import:
from Import Fastica
To build an ICA object, select fractions:
ICA = Fastica (n_components=6)
(The composition is randomly arranged, using random_state for repeatability analysis if necessary)
s corresponds to the composition of S_:
S_ = Ica.fit_transform (S)
The corresponding mix matrix is:
Ica.mixing_
Filter noise
For s_ mapping, X is time point,y for each component. Determine the source of the suspected noise.
For example, get:
Suppose 5th, 60% is divided into sources of noise, delete the ingredient, rebuild the fix s:corr_s
corr_s = Np.dot (s_[:,: 4], Ica.mixing_. T[:4,:])
Results
Filter before noise
After filter noise
Complete
Using ICA for EEG noise filtering