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, norm=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, norm=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, f=(8, 14), norm=true)