NeuroAnalyzer tutorials: Calculate and plot PSD slope

Load EEG object:

eeg = import_edf("test/eeg-test-edf.edf")
channel = 1
epoch = 1

Calculate PSD data using Welch periodogram:

p, f = psd(eeg, db=true)

Draw scatter plot of PSD data:

scatter(f, p[channel, :], ms=1, legend=false)

Calculate and plot PSD slope:

f, ps, frq = psd_slope(eeg, db=true)
plot!(frq, f[channel, :, epoch], title="slope = $(round(ps[channel, epoch], digits=2))")

Calculate PSD slope of the alpha band:

f, ps, frq = psd_slope(eeg, frq_lim=(8, 14), db=true)