This repository contains code for analyzing Steady-State Visually Evoked Potential (SSVEP) signals recorded from EEG data. The goal of this analysis is to determine the stimulation frequency from the EEG signals recorded in each test. Two methods are employed: Frequency Content Plotting and Canonical Correlation Analysis (CCA).
The SSVEP.mat
file contains the following data:
SSVEP_Signal
: A matrix (6x117917) containing EEG signals recorded from 6 channels (O2, P8, P7, Oz, Pz, and O1) with a sampling frequency of 250 Hz.Events
: A matrix (1x15) containing stimulation frequencies.Event_samples
: A matrix (1x15) containing time samples corresponding to the start of each stimulation.
- Bandpass Filtering: Remove frequencies below 1 Hz and above 40 Hz.
- Trial Segmentation: Separate trials corresponding to 15 stimuli with a window size of 5 seconds.
- Frequency Content Calculation: Calculate the frequency content of each channel using the Welch method.
- Channel Comparison: Analyze differences in frequency content across channels.
- Dominant Frequency Identification: Determine the dominant frequency for each trial.
- Trial Segmentation: Similar to Frequency Content Plotting.
- CCA Method: Apply CCA to determine dominant frequencies. Compare coefficients obtained from different stimulation frequencies.
- Channel Subset Analysis: Evaluate the impact of reducing the number of channels on classification accuracy.
- Window Length Analysis: Assess the effect of varying the length of the time window on classification accuracy.
- Frequency Content Plotting reveals variations in frequency content across channels, potentially indicating differences in brain regions and functions.
- CCA accurately identifies dominant frequencies, with high classification accuracy.
- Channel subset and window length analyses demonstrate the importance of selecting an appropriate subset of channels and time window length for accurate classification.
To use this code, ensure you have the SSVEP.mat
file containing the EEG data. Adjust parameters such as frequency range, window size, and overlap as needed. Run the provided scripts for Frequency Content Plotting and CCA analysis.
Feel free to contribute to this repository by improving the analysis methods or adding additional features.