SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Computing Statistics : SignalProcessing/RootMeanSquare

SignalProcessing

 RootMeanSquare
 calculate the root mean square of a signal

 Calling Sequence RootMeanSquare( data )

Parameters

 data - rtable of data

Description

 • The RootMeanSquare command takes a 1-D rtable of data and returns the root mean square. Specifically,

$\mathrm{RootMeanSquare}\left(A\right)=\sqrt{\frac{{\sum }_{i=1}^{n}{\left|{A}_{i}\right|}^{2}}{n}}$

 where $n=\mathrm{numelems}\left(A\right)$.
 • The input is converted to an Array of either float[8] or complex[8] datatype, and an error will be thrown if this is not possible. For this reason, it is most efficient for the input to already be an Array having the appropriate datatype.
 • As the underlying implementation of the SignalProcessing package is a module, it is also possible to use the form SignalProcessing:-RootMeanSquare to access the command from the package. For more information, see Module Members.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$

Simple Examples

 > $X≔\mathrm{Array}\left(\left[1,2I,3\right]\right)$
 ${X}{≔}\left[\begin{array}{ccc}{1}& {2}{}{I}& {3}\end{array}\right]$ (1)
 > $\mathrm{RootMeanSquare}\left(X\right)$
 ${2.16024689946929}$ (2)
 > $Y≔⟨3\mathrm{sqrt}\left(2\right),4\mathrm{sqrt}\left(2\right)⟩$
 ${Y}{≔}\left[\begin{array}{c}{3}{}\sqrt{{2}}\\ {4}{}\sqrt{{2}}\end{array}\right]$ (3)
 > $\mathrm{RootMeanSquare}\left(Y\right)$
 ${5.}$ (4)

Parseval's Theorem

 • Parseval's Theorem shows that the root mean square of the Discrete Fourier Transform (DFT) of a signal is the same as that of the original signal. For example:
 > $A≔\mathrm{LinearAlgebra}:-\mathrm{RandomVector}\left(5,\mathrm{datatype}=\mathrm{complex}\left[8\right]\right)$
 ${A}{≔}\left[\begin{array}{c}{-94.}{-}{58.}{}{I}\\ {12.}{-}{7.}{}{I}\\ {21.}{-}{53.}{}{I}\\ {40.}{-}{25.}{}{I}\\ {43.}{+}{97.}{}{I}\end{array}\right]$ (5)
 > $B≔\mathrm{Vector}\left[\mathrm{column}\right]\left(\mathrm{DFT}\left(A\right)\right)$
 ${B}{≔}\left[\begin{array}{c}{9.83869910099907}{-}{20.5718253929981}{}{I}\\ {-108.101349850469}{+}{32.8995037690910}{}{I}\\ {-68.9361787597612}{-}{69.2123797669952}{}{I}\\ {-38.0783657332284}{-}{69.3476788839996}{}{I}\\ {-4.91319464252088}{-}{3.45956242008582}{}{I}\end{array}\right]$ (6)
 > $\mathrm{rms__A}≔\mathrm{RootMeanSquare}\left(A\right)$
 $\mathrm{rms__A}{≔}{76.3229978446864}$ (7)
 > $\mathrm{rms__B}≔\mathrm{RootMeanSquare}\left(B\right)$
 $\mathrm{rms__B}{≔}{76.3229978446864}$ (8)
 • We can also compare the original signal with the Inverse Discrete Fourier Transform (IDFT) of its DFT:
 > $C≔\mathrm{InverseDFT}\left(B\right)$
 ${C}{≔}\left[\begin{array}{ccccc}{-94.0000000000000}{-}{58.}{}{I}& {12.0000000000000}{-}{7.00000000000001}{}{I}& {21.0000000000000}{-}{53.0000000000000}{}{I}& {40.0000000000000}{-}{25.}{}{I}& {43.}{+}{97.}{}{I}\end{array}\right]$ (9)
 > $\mathrm{RootMeanSquare}\left(A-C\right)$
 ${1.35981247304106}{}{{10}}^{{-14}}$ (10)

Compatibility

 • The SignalProcessing[RootMeanSquare] command was introduced in Maple 2020.