RMS - Compute root-mean-square value of input or sequence of inputs

Library

Statistics

dspstat3

Description

The RMS block computes the RMS value of each row or column of the input, along vectors of a specified dimension of the input, or of the entire input. The RMS block can also track the RMS value in a sequence of inputs over a period of time. The Running RMS parameter selects between basic operation and running operation.

Basic Operation

When you do not select the Running RMS check box, the block computes the RMS value of each row or column of the input, along vectors of a specified dimension of the input, or of the entire input at each individual sample time, and outputs the array y. Each element in y is the RMS value of the corresponding column, row, vector, or entire input. The output y depends on the setting of the Find the RMS value over parameter. For example, consider a 3-dimensional input signal of size M-by-N-by-P:

The RMS value of the jth column of an M-by-N input matrix u is given by

y = sqrt(sum(u.*conj(u))/size(u,1))	   	% Equivalent MATLAB code

Running Operation

When you select the Running RMS check box, the block tracks the RMS value of successive inputs to the block. For sample-based M-by-N inputs, the output is a sample-based M-by-N matrix, with each element yij containing the RMS value of element uij over all inputs since the last reset. For frame-based M-by-N inputs, the output is a frame-based M-by-N matrix with each element yij containing the RMS value of the jth column over all inputs since the last reset, up to and including element uij of the current input.

N-D signals cannot be frame based. When the Running RMS check box is selected, each element of the N-D signal is treated as a separate channel.

There are channels, where di is the size of the ith dimension.

Resetting the Running RMS

The block resets the running RMS whenever a reset event is detected at the optional Rst port. The reset sample time must be a positive integer multiple of the input sample time.

When the block is reset for sample-based inputs, the running RMS for each channel is initialized to the value in the corresponding channel of the current input. For frame-based inputs, the running RMS for each channel is initialized to the earliest value in each channel of the current input.

You specify the reset event in the Reset port parameter:

Examples

The RMS block in the next model calculates the running RMS of a frame-based 3-by-2 (two-channel) matrix input, u. The running RMS is reset at t=2 by an impulse to the block's Rst port.

The RMS block has the following settings:

The Signal From Workspace block has the following settings:

where

dsp_examples_u = [6 1 3 -7 2 5 8 0 -1 -3 2 1;1 3 9 2 4 1 6 2 5 0 4 17]'

The Discrete Impulse block has the following settings:

The block's operation is shown in the next figure.

Dialog Box

Running RMS

Enables running operation when selected.

Reset port

Determines the reset event that causes the block to reset the running RMS. The reset signal rate must be a positive integer multiple of the rate of the data signal input. This parameter is enabled only when you set the Running RMS parameter. For more information, see Resetting the Running RMS.

Find the RMS value over

Specify whether to find the RMS value along rows, columns, entire input, or the dimension specified in the Dimension parameter. For more information, see Basic Operation.

Treat sample-based row input as a column

Select to treat sample-based length-M row vector inputs as M-by-1 column vectors. This parameter is only visible when the Find the RMS value over parameter is set to Each column.

Dimension

Specify the dimension (one-based value) of the input signal, over which the RMS value is computed. The value of this parameter cannot exceed the number of dimensions in the input signal. This parameter is only visible when the Find the RMS value over parameter is set to Specified dimension.

Supported Data Types

See Also

MeanSignal Processing Blockset
VarianceSignal Processing Blockset

  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS