Skip to contents

Returns bandpower(psd, band1) / bandpower(psd, band2).

Usage

morie_dsp_spectral_ratio(psd, freqs, band1, band2)

Arguments

psd

PSD vector.

freqs

Matching frequency vector.

band1

Length-2 numeric (low, high) Hz.

band2

Length-2 numeric (low, high) Hz.

Value

Scalar ratio.

References

Rangayyan & Krishnan (2015), Ch. 6, sec. 6.6.

Examples

freqs <- seq(0, 250, length.out = 256L)
psd <- rep(1, length(freqs))
morie_dsp_spectral_ratio(psd, freqs, band1 = c(10, 30), band2 = c(50, 100))
#> [1] 0.3846154