
EEG band-power decomposition via Welch PSD
Source:R/entheo_dmt.R
morie_entheo_spectral_band_power.RdR parity of morie.entheo_dmt.spectral_band_power. Wraps
rgpsd (morie's Welch PSD; same algorithm as SciPy's
welch) and integrates the PSD over each canonical band by
the trapezoidal rule.
Usage
morie_entheo_spectral_band_power(
signal,
fs = 200,
bands = .MORIE_ENTHEO_DEFAULT_BANDS,
nperseg = NULL
)Arguments
- signal
numeric vector. A 1-D EEG time series.
- fs
numeric. Sampling frequency in Hz. Default 200 Hz (Timmermann 2023 acquisition).
- bands
list of
list(name=, lo=, hi=)entries. Default = canonical delta/theta/alpha/beta/gamma.- nperseg
integer or NULL. Welch segment length. Defaults to
min(length(signal), max(64, 4*fs))– 4-second segments at fs.
References
Welch, P. (1967). The use of FFT for the estimation of power spectra. IEEE Trans. Audio Electroacoust. 15(2): 70-73. Rangayyan, R. M. & Krishnan, S. (2024). Biomedical Signal Analysis, 3rd ed., Ch. 5.
Examples
set.seed(1)
fs <- 200
t <- seq_len(4 * fs) / fs
sig <- sin(2 * pi * 10 * t) + 0.1 * rnorm(length(t))
res <- morie_entheo_spectral_band_power(sig, fs = fs)
res$payload$rows[[1]]
#> $band
#> [1] "delta"
#>
#> $f_lo
#> [1] 0.5
#>
#> $f_hi
#> [1] 4
#>
#> $abs_power
#> [1] NA
#>
#> $rel_power
#> [1] NA
#>