CalcRMS: Calculate 'RMS'

CalcRMSR Documentation

Calculate RMS

Description

This function calculates the running RMS value of multi-channel signal as

\code{RMS}\{F(A)\}=w^{-1}≤ft(∑_{i=τ_{1}}^{τ_1 +w}\cdots∑_{i=τ_{l}}^{τ_l+w}A_{ij}^{2}\right)^{1/2}\quad (j=1,…,m),

where F is a function that divides the signal in l-equispaced time frames of length w and A=(A_{i1},…,A_{im})^\top is a m dimensional vector representing the multi-channel signal. As a result, we obtain a l \times m vector with the RMS values for each time frame and channel. The RMS value is generated every inFrameInterval seconds over a period τ of inFrameWidth seconds.

Usage

CalcRMS(inSignal, inSampleFreq, inFrameWidth, inFrameInterval)

Arguments

inSignal

the input signal. If this is a matrix, RMS values are calculated for each channel.

inSampleFreq

the sample frequency of the input signal (in Hz).

inFrameWidth

the period over which the RMS is calculated (in s).

inFrameInterval

the period between two successive frames (in s).

Value

An object of class "AI" that contains the running RMS value (RMSSignal) of the given signal and its sample frequency (RMSFreq).

Author(s)

Marc Vidal (R version). Based on the original code from IPEM Toolbox.

Examples

data(SchumannKurioseGeschichte)
s <- SchumannKurioseGeschichte
ANIs <- CalcANI(s, 22050)
RMS <- CalcRMS(ANIs$AuditoryNerveImage, ANIs$ANIFreq, 0.029, 0.0058)

m-vidal/eaR documentation built on Nov. 18, 2022, 3:55 p.m.