movingrms: Moving Root Mean Square

View source: R/movingrms.R

movingrmsR Documentation

Moving Root Mean Square

Description

Compute the moving root mean square (RMS) of the input signal.

Usage

movingrms(x, width = 0.1, rc = 0.001, fs = 1)

Arguments

x

Input signal, specified as a numeric vector or matrix. In case of a matrix, the function operates along the columns

width

width of the sigmoid window, in units relative to fs. Default: 0.1

rc

Rise time (time constant) of the sigmoid window, in units relative to fs. Default: 1e-3

fs

Sampling frequency. Default: 1

Details

The signal is convoluted against a sigmoid window of width w and risetime rc. The units of these parameters are relative to the value of the sampling frequency given in fs.

Value

A list containing 2 variables:

rmsx

Output signal with the same dimensions as x

w

Window, returned as a vector

Author(s)

Juan Pablo Carbajal, carbajal@ifi.uzh.ch.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

See Also

sigmoid_train

Examples

       
N <- 128
fs <- 5
t <- seq(0, 1, length.out = N)
x <- sin(2 * pi * fs * t) + runif(N)
y <- movingrms(x, 5)


gjmvanboxtel/gsignal documentation built on Nov. 22, 2023, 8:19 p.m.