SSVEP Demo data analysis

We've been digging through the SSVEP open demo code a bit, and we have a question about the CCA classifier that is being used to determine which target the participant is looking at. Appreciate for your reply in advance :slight_smile:

So,
(1) In the CCA classifier, the open Demo code seems to generate sine and cosine waves of the same frequency as that of the target to use it as train_data.
Why is only a sine and cosine wave being used to find associations with the EEG signal?

(2) Also, when harmonics = 0, the two arrays generated are all zeros for sine(0) or ones for cosine(0).
What purpose do these arrays serve?
Could you please point us in the right direction or help me understand the overall function of _init_train_data better?

--> For the Code, see below

def _init_train_data(self):
    t_vec = np.linspace(0, self.win_len, int(self.s_rate * self.win_len))
    targets = {}
    for freq in self.freqs:
        sig_sin, sig_cos = [], []
        for harmonics in range(self.n_harmonics):
            sig_sin.append(np.sin(2 * np.pi * harmonics * freq * t_vec))
            sig_cos.append(np.cos(2 * np.pi * harmonics * freq * t_vec))
        targets[freq] = np.array(sig_sin + sig_cos).T
    return targets

Which data and code are you referring to exactly, please?

I am using Mentalab Device, and extracted EEG data by using that device.

I am also attaching the Mentalab Code that I am referring to,
https://github.com/Mentalab-hub/explorepy/blob/master/examples/ssvep_demo/analysis.py

This is not Brainstorm code.

If you want to analyze data from the Metalab device in Brainstorm you can converted to CSV, which is a supported format. You can find more information on getting started in Brainstorm here:

https://neuroimage.usc.edu/brainstorm/Tutorials#Get_started