Learn R Programming

rsleep (version 1.0.12)

bands_psd: Compute power spectral density of bands listed in the bands argument.

Description

`bands_psd` calculates power spectral densities estimates on bands. Bands are computed from spectrogram bands equal or greater than lower limit and inferior to the upper limit.

Usage

bands_psd(signal, sRate, bands, normalize = FALSE, method = "pwelch")

Value

A list of bands powers.

Arguments

signal

Numerical vector of the signal.

sRate

Signal sample rate in Hertz.

bands

A list of bands to compute with lower and upper limits in the form `list(c(0,4),c(4,8))``

normalize

A band to normalize (divide) by. Defaults to `c(0.5,40)`. Can be set up to FALSE for raw results. Defaults to FALSE.

method

Character. Method to use to compute power spectral density. "pwelch" or "psm". Defaults to "pwelch".

Examples

Run this code
signal <- sin(seq(0,100,0.01))
bands_psd(bands = list(c(0,4),c(4,8)), signal = signal, sRate = 200)

Run the code above in your browser using DataLab