Plot band power in the δ, θ, α and β ranges

NeuroAnalyzer tutorials: Plot band powers

Load data:

using NeuroAnalyzer
using Plots
eeg = load("files/eeg.hdf");
[ Info: Loaded: EEG (24 × 282991 × 1; 1105.43 s)

Collect frequency bounds:

bands = [:delta, :theta, :alpha, :beta]
frq = Vector{Tuple{Float64, Float64}}()
for idx in bands
    push!(frq, band_frq(eeg, band=idx))
end

Calculate power for channel 2, epoch 1:

bp = Vector{Float64}()
ch = 2
ep = 1
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 relative to alpha band power

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)