EEG-Fractal-Analysis
A MATLAB code for fractal analysis and visualization of EEG signals
How to Use
- Save each subject’s EEG recordings in a matrix named “EEG” then save it as a .mat file named “N.mat” (N={1, 2, .., subj_count}) in the working directory.
Each subject's EEG recordings matrix: [c, e, t] c: number of channels e: epoc trains (points in time) t: number of trials
- Set the subject count (subj_count) in “fractal_dim.m”.
- Run “fractal_dim.m” and select 1 for Katz FD (fractal dimension) 2 for Higuchi FD or 3 for Fractional Brownian Motion when prompted.
- If you are comparing two groups of subjects, create a separate folder for each one, containing the EEG recordings of all of that group’s subjects, and copy “fractal_dim.m” in each folder and run it.
- Name the resulting matrices as “RESULTS_G1” and “RESULTS_G2” and save them as “RESULTS_GROUP1.mat” and “RESULTS_GROUP2.mat” respectively.
- Set the number of channels in “statistical_results.m” and run.
- Save the results matrix as “RESULTS.mat”.
- Add the “eeglab” toolbox to MATLAB.
- In the command line type
>> eeglab
. - Copy “Channels_loc.mat” to the working directory and run “topoplot_results.m”.
The channel location matrix is availible Channel_loc.mat
Electrode Count: 18 (not counting the reference electrode)
Electrode Locations: Fp1, Fp2, F3, F4, F7, F8, Fz, C3, C4, Cz, T3, T4, T5, T6, P3, P4, Pz, O1, O2
Reference Electrode: Cz
Electrode Formation: 10-20 (international system)
How it Works
Each subject’s EEG recording is bandpass filtered into the following frequency bands:
1. delta band (1-4Hz)
2. theta band (4-8Hz)
3. alpha I band (8-10Hz)
4. alpha II band (10-12Hz)
5. alpha band (8-13Hz)
6. beta I band (12-15Hz)
7. beta II band (15-18Hz)
8. beta III band (18-25Hz)
9. beta IV band (25-30Hz)
10. beta band (13-30Hz)
11. gamma band (30-40Hz)
12. all frequency bands
Then, depending on the chosen method (Katz, Higuchi, Fractional Brownian Motion), the fractal dimension for each channel will be calculated in each frequncy band for each subject. Next, the results from a t-test, comparing the results from the two groups, is used for the topoplots.