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
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