DSP Blockset
  Go to block:
    Search    Help Desk 
RMS    See Also

Compute the root-mean-square (RMS) value of an input or sequence of inputs.

Library

Statistics, in Math Functions

Description

The RMS block computes the root-mean-square value of the elements in the input vector, or tracks the RMS value of a sequence of inputs over a period of time. The Running RMS parameter allows you to select between basic operation and running operation, which are described below.

Basic Operation

When the Running RMS check box is not selected, the block computes the RMS value of the input vector at each sample time.

This implements the following mathematical formula.

A matrix input is treated as a vector, u(:).

Running Operation

When the Running RMS check box is selected, the block tracks the RMS value of a sequence of inputs over time. You can choose frame-based or sample-based operation by selecting (or deselecting, respectively) the Frame-based check box.

Sample-Based Operation.    When the Frame-based check box is not selected (default), the block assumes that the input at the In port is a 1-by-N sample vector or M-by-N sample matrix. Each of the N vector elements (or M*N matrix elements) is treated as an independent channel, and the block tracks the RMS value of each of the channels over time.

The block resets the running RMS value when the scalar input at the optional Rst port is nonzero. The output is the same size as the input, and contains the RMS value for each input channel since the last reset.

If you do not need to reset the running RMS value during the simulation, you can delete the Rst port from the block icon by deselecting the Reset port check box.

Frame-Based Operation.    When the Frame-based check box is selected, the block assumes that the input at the In port is an M-by-N frame matrix. Each of the N frames in the matrix contains M sequential time samples from an independent signal. The Number of channels parameter specifies the number of independent signals, N, in the matrix.

The block tracks the RMS value of each of the N independent channels over time, and resets the running RMS value when the input at the Rst port is nonzero. The output is a sample vector of length N which contains the RMS value for each input channel since the last reset.

Note
If you expect to generate code for the RMS block's running mode using the Real-Time Workshop, you should ensure that inputs are contiguous in memory. See the Contiguous Copy block for more information.

Dialog Box

Running RMS
Selects running operation.
Reset port
Enable Rst input port.
Frame-based
Selects frame-based operation.
Number of channels
For frame based operation, the number of channels (columns) in the input matrix, N.

See Also

Mean
Variance



[ Previous | Help Desk | Next ]