Python code explaining why Canonical Correlation Analysis (CCA) works in detecting Steady State Visually Evoked Potentials (SSVEP).
The data used in this repository is freely available here
I used the dataset data_s19_64.mat
and set the block ID to 2; frequency = 12 Hz; condition = low depth. The plot shows the comparison when using reference signals of 8 Hz, 12 Hz, and 16 Hz. As can be seen, despite the attempts to find linear combinations of a multi-channel EEG data for each of the reference signals, the target frequency (12 Hz) achieves the highest canonical correlation.
In the script cca_tutorial_02.py
, we investigate how much each channel contributed to reach the higher correlation for 12 Hz target frequency.
Now, we can also plot the Topography of these channel activations.
Disclaimer: I tried my best to find the EEG channel locations for the Neuroscan 64-channel setup. The results show activations in the Parietal-Occipital area (lateralized), which matches our expectations. However, I am not 100% sure about the channel locations used. If you find this to be wrong, feel free to submit a PR with the correct locations.