RootMeanSquare - Maple Help

SignalProcessing

 RootMeanSquare
 calculate the root mean square of a signal

 Calling Sequence RootMeanSquare( data )

Parameters

 data - rtable or list of data

Description

 • The RootMeanSquare command takes an rtable or list of data and returns the Root Mean Square (RMS). When $A$ is a Vector with $n$ elements:

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

 • The input is converted to a 1-D Vector 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 rtable having the appropriate datatype.
 • The RootMeanSquare command is not thread safe.

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.16024689946928694}$ (2)
 > $Y≔\left[3\sqrt{2},4\sqrt{2}\right]$
 ${Y}{≔}\left[{3}{}\sqrt{{2}}{,}{4}{}\sqrt{{2}}\right]$ (3)
 > $\mathrm{RootMeanSquare}\left(Y\right)$
 ${5.}$ (4)
 > $Z≔\mathrm{Matrix}\left(\left[\left[5,-10\right],\left[15,20+I\right]\right]\right)$
 ${Z}{≔}\left[\begin{array}{cc}{5}& {-10}\\ {15}& {20}{+}{I}\end{array}\right]$ (5)
 > $\mathrm{RootMeanSquare}\left(Z\right)$
 ${13.7021896060447208}$ (6)

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}}_{8}\right)$
 ${A}{≔}\left[\begin{array}{c}{-94.}{-}{58.}{}{I}\\ {12.}{-}{7.}{}{I}\\ {21.}{-}{53.}{}{I}\\ {40.}{-}{25.}{}{I}\\ {43.}{+}{97.}{}{I}\end{array}\right]$ (7)
 > $B≔{\mathrm{Vector}}_{\mathrm{column}}\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]$ (8)
 > $\mathit{rms__A}≔\mathrm{RootMeanSquare}\left(A\right)$
 $\mathrm{rms__A}{≔}{76.3229978446863555}$ (9)
 > $\mathit{rms__B}≔\mathrm{RootMeanSquare}\left(B\right)$
 $\mathrm{rms__B}{≔}{76.3229978446863555}$ (10)
 • We can also compare the original signal with the Inverse Discrete Fourier Transform (IDFT) of its DFT:
 > $C≔{\mathrm{Vector}}_{\mathrm{column}}\left(\mathrm{InverseDFT}\left(B\right)\right)$
 ${C}{≔}\left[\begin{array}{c}{-94.0000000000000}{-}{58.}{}{I}\\ {12.0000000000000}{-}{7.00000000000001}{}{I}\\ {21.0000000000000}{-}{53.0000000000000}{}{I}\\ {40.0000000000000}{-}{25.}{}{I}\\ {43.}{+}{97.}{}{I}\end{array}\right]$ (11)
 > $\mathrm{RootMeanSquare}\left(A-C\right)$
 ${1.35981247304106290}{×}{{10}}^{{-14}}$ (12)

Compatibility

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