using NeuroAnalyzer
using Plots
= load("files/eeg.hdf"); eeg
[ Info: Loaded: EEG (24 × 282991 × 1; 1105.43 s)
Load data:
using NeuroAnalyzer
using Plots
= load("files/eeg.hdf"); eeg
[ Info: Loaded: EEG (24 × 282991 × 1; 1105.43 s)
Collect frequency bounds:
= [:delta, :theta, :alpha, :beta]
bands = Vector{Tuple{Float64, Float64}}()
frq for idx in bands
push!(frq, band_frq(eeg, band=idx))
end
Calculate power for channel 2, epoch 1:
= Vector{Float64}()
bp = 2
ch = 1
ep for idx in frq
push!(bp, band_power(eeg, ch="all", frq_lim=idx)[ch, ep])
end
Plot PSD and add band ranges:
plot_psd(eeg, ch="Fp2", ep=1, db=false, frq_lim=(0, 30), mono=true)
vline!(frq, lc=:black, alpha=0.5, lw=0.5)
Plot band powers:
plot_bar(bp, xlabels=string.(bands), xlabel="", ylabel="Power [μV²/Hz]", title="Band powers\n[channel: $ch, epoch: $ep]")
plot_psd(eeg, ch="Fp2", ep=ep, ref=:alpha, frq_lim=(0, 30), mono=true)
vline!(frq, lc=:black, alpha=0.5, lw=0.5)