我遵循the answer to this question和this scikit-learn tutorial来go 除脑电信号中的伪影.它们看起来很简单,我肯定错过了一些显而易见的东西.
提取的成分与我的信号长度不同.我有88个频道的几个小时的录音,所以我的信号矩阵的形状是(888088516).然而ICA的输出是(88,88).除了很短之外,每个组件似乎都捕捉到了非常大的、看起来有噪音的偏转(所以在88个组件中,只有一对看起来像信号,其余的看起来像噪音).我还以为只有几个部件看起来很吵.我怀疑我做错了什么?
通道x样本的矩阵具有形状(888088516).
示例代码(仅使用随机矩阵进行最低限度的工作):
import numpy as np
from sklearn.decomposition import FastICA
import matplotlib.pyplot as plt
samples_matrix = np.random.random((88, 8088516))
# Compute ICA
ica = FastICA(n_components=samples_matrix.shape[0]) # Extracting as many components as there are channels, i.e. 88
components = ica.fit_transform(samples_matrix) # Reconstruct signals
A_ = ica.mixing_ # Get estimated mixing matrix
组件的形状为(88,88).其中一个是这样的:
plt.plot(components[1])
我本以为这些成分是与我最初的as shown in the answer to this question个时间序列长度相同的时间序列.我真的不知道如何在这一点上推进组件移除和信号重建.