Hello,

I am trying to implement a frequency-PCA in Matlab/fieldtrip (or Python alternatively).

The idea of this approach is to identify the major frequency components in the EEG data in a data-driven way. Each component is characterized by a dominant frequency and a topography (electrodes that contribute most to it) (like in Barry & De Blasio 2017 for example).

If I understood correctly the steps are:

1. Compute an FFT for each subject and recording

2. Apply PCA on the obtained power spectra across all the subjects and recordings

3. Apply promax or varimax rotation on the obtained coefficients.

I have tried these steps in Matlab, pseudocode below:

powerspectra = [];

for subject in subjects:

for recording in recordings:

cfg = [];

cfg.output = 'pow';

cfg.channel = 'all';

cfg.method = 'mtmfft';

cfg.taper = 'hann';

cfg.keeptrials = 'no';

cfg.foilim = [1 40];

FFT_EEG = ft_freqanalysis(cfg, data_eeg);

powerspectra = [powerspectra; FFT_EEG.powspctrm];

end

end

[coeff,score,latent] = pca(powerspectra);

% Perform Promax rotation on the principal components

rot_matrix = promax(coeff,3);

% apply the rotation to the principal components

rot_coeff = coeff*rot_matrix';

However, the resulting components do not look meaningful (except maybe the first component, see figures attached).

There must be something I'm missing in my implementation? I would greatly appreciate any hint or lead. Thank you

More Nicolai Wolpert's questions See All
Similar questions and discussions