intan.decomposition package

Decomposition methods for EMG, including PCA and constrained ICA utilities.

pca(X, n_components=15, variance_threshold=0.95, show_plot=False, verbose=False)[source]

Implements PCA on a dataset with the number of components specified.

Parameters:
  • X – Input data of shape (samples, channels)

  • n_components – Number of components to keep.

Returns:

Reconstructed data using the first k components. n_pca_95: Number of components needed to reach 95% variance.

Return type:

X_reconstructed_k

CFICA2(emg_data, param=None, Mu=None)[source]

Python version of CFICA2: Kernel and Correlation Constrained FastICA for HD-EMG

whitening_pca(x, delay)[source]
delay_embed(x, delay)[source]

Emulates the yanchi() function from MATLAB’s CFICA2. Returns (2*delay + 1)*channels x samples matrix

kernel_fastica(X, A=None, threshold=1e-06)[source]
corr_constrained_ica(X, S, threshold=1e-06)[source]
threshold_cov(x, peak_interval)[source]
discard_redundant_spikes(S, MUpulse, threshold=0.4)[source]
waveform_estimation(y, S, wavelength)[source]