Main Content

rssq

Root-sum-of-squares level

Description

example

y = rssq(x) returns the root-sum-of-squares (RSS) level, y, of the input array x. If x is a row or column vector, y is a real-valued scalar. If x has more than one dimension, then rssq operates along the first array dimension with size greater than 1.

example

y = rssq(x,dim) computes the RSS level of x along dimension dim.

Examples

collapse all

Compute the RSS level of a 100 Hz sinusoid sampled at 1 kHz.

t = 0:0.001:1-0.001;
x = cos(2*pi*100*t);

y = rssq(x)
y = 22.3607

Create a matrix where each column is a 100 Hz sinusoid sampled at 1 kHz with a different amplitude. The amplitude is equal to the column index.

Compute the RSS levels of the columns.

t = 0:0.001:1-0.001;
x = cos(2*pi*100*t)'*(1:4);

y = rssq(x)
y = 1×4

   22.3607   44.7214   67.0820   89.4427

Create a matrix where each row is a 100 Hz sinusoid sampled at 1 kHz with a different amplitude. The amplitude is equal to the row index.

Compute the RSS levels of the rows by specifying the dimension with the dim argument.

t = 0:0.001:1-0.001;
x = (1:4)'*cos(2*pi*100*t);

y = rssq(x,2)
y = 4×1

   22.3607
   44.7214
   67.0820
   89.4427

Input Arguments

collapse all

Input array, specified as a vector, matrix, or N-D array.

Example: cos(2*pi*100*(0:0.001:1-0.001)) specifies a sinusoid sampled at 1 kHz for 1 second.

Data Types: single | double
Complex Number Support: Yes

Dimension to operate along, specified as a positive integer scalar.

Data Types: single | double

Output Arguments

collapse all

Root-sum-of-squares level, returned as a scalar, vector, matrix, or N-D array.

More About

collapse all

Root-Sum-of-Squares Level

The root-sum-of-squares (RSS) level of a vector, x, is

xRSS=n=1N|xn|2,

with the summation performed along the specified dimension. The RSS level is also referred to as the 2-norm.

References

[1] IEEE® Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003.

Extended Capabilities

See Also

| | | |

Introduced in R2012a