Compact MATLAB analysis of EEG band-power variability and its low-frequency coherence with cerebral blood flow velocity (BFV2).
The repository studies whether slow fluctuations in EEG band power show frequency-domain association with slow fluctuations in BFV2 within a single physiological recording. It is structured as a reproducible exploratory analysis rather than a large software framework.
The dataset includes:
F4C4: frontal EEG channelP3O1,P4O2: posterior EEG channelsBFV2: cerebral blood flow velocityFs_EEG = 512 HzFs_BFV = 0.5 Hz
The analysis converts EEG into one band-power value per 2-second epoch, producing slow power-variability signals that can be compared with BFV2 on the same effective time scale.
Bands analyzed:
delta: 0.5-4 Hztheta: 4-8 Hzalpha: 8-13 Hzbeta: 13-30 Hz
- EEG channels are segmented into non-overlapping 2-second epochs.
- Welch PSD is estimated within each epoch.
- Band power is obtained by integrating the PSD over each frequency band.
- Epoch-wise band power values are assembled into slow power-variability time series.
- Magnitude-squared coherence is computed between each band-power variability signal and
BFV2. - Coherence is summarized over
0.02-0.15 Hzusing peak coherence, peak frequency, mean coherence, and area under the coherence curve.
Two channel-selection strategies are exported:
primary: delta, theta, and beta fromF4C4; alpha from a posterior channel when available (P3O1preferred, thenP4O2)same_channel_control: all bands fromF4C4
The control analysis is included to make band comparisons easier to interpret when alpha is estimated from a different channel than the other bands.
.
|-- data/
| `-- dataset09.mat
|-- figures/
| |-- fig01_example_channels.png
| |-- fig02_band_power_variability.png
| |-- fig03_coherence_with_bfv2.png
| `-- fig04_strategy_comparison.png
|-- results/
| |-- analysis_outputs.mat
| |-- strategy_comparison.csv
| |-- summary_primary.csv
| `-- summary_same_channel_control.csv
|-- src/
| |-- analyzeStrategy.m
| |-- computeBandPowerVariability.m
| |-- defaultConfig.m
| |-- epochSignal.m
| |-- exportProjectOutputs.m
| `-- loadDataset.m
|-- LICENSE
|-- main.m
`-- README.md
Open MATLAB in the repository root and run:
mainThe script loads data/dataset09.mat, runs the full analysis, saves figures to figures/, and writes tabular and MAT outputs to results/.
Tested locally with MATLAB R2024b.
The repository exports:
- example channel plots
- band-power variability plots
- coherence plots for the primary strategy
- a strategy-comparison figure
- CSV summaries for the primary and control analyses
- a MAT file containing the full exported analysis state
- This is a single-recording exploratory analysis, not a population study.
- Coherence measures frequency-domain association and should not be interpreted as causality.
- The primary strategy mixes channel location with band selection, so it should be interpreted as a band-plus-channel comparison.
- The same-channel control improves interpretability but is not a formal null model or significance test.
- Add a simple surrogate or permutation-based null analysis for coherence.
- Compare additional same-channel and cross-channel strategies.
- Apply the pipeline to multiple recordings if comparable datasets are available.