| Algorithm 3 ICA based denoising of EEG signals |
| Input: X: EEG data matrix |
| Input: : number of independent components to estimate |
| Output: S: matrix of independent components |
| Output: A: estimated demixing matrix |
| Center and whiten the X. |
| Initialize A randomly. |
| repeat |
| Update A by exploiting non-Gaussianity of independent sources. |
| until convergence |
| Compute S from A and X. |
| Identify artifact components in S. |
| Remove artifact components from S. |
| Reconstruct cleaned data from S. |
| return S, A |