Minimum - Find minimum values in input or sequence of inputs

Library

Statistics

dspstat3

Description

The Minimum block identifies the value and/or position of the smallest element in each row or column of the input, along vectors of a specified dimension of the input, or of the entire input. The Minimum block can also track the minimum values in a sequence of inputs over a period of time. The Mode parameter specifies the block's mode of operation, and can be set to Value, Index, Value and Index, or Running.

The Minimum block supports real and complex floating-point, fixed-point, and Boolean inputs. Real fixed-point inputs can be either signed or unsigned, while complex fixed-point inputs must be signed. The data type of the minimum values output by the block match the data type of the input. The index values output by the block are double when the input is double, and uint32 otherwise.

The frame status of the block output is the same as that of the input, except when the Find the minimum value of parameter is set to Entire input. The output is always sample-based when Entire input is selected.

For the Value, Index, and Value and Index modes, the Minimum block produces identical results as the MATLAB® min function when it is called as [y I] = min(u,[],D), where u and y are the input and output, respectively, D is the dimension, and I is the index.

Value Mode

When the Mode parameter is set to Value, the block computes the minimum value in each row or column of the input, along vectors of a specified dimension of the input, or of the entire input at each sample time, and outputs the array y. Each element in y is the minimum value in the corresponding column, row, vector, or entire input. The output y depends on the setting of the Find the minimum value over parameter. For example, consider a 3-dimensional input signal of size M-by-N-by-P:

For complex inputs, the block selects the value in each row or column of the input, along vectors of a specified dimension of the input, or of the entire input that has the minimum magnitude squared as shown below. For complex value , the magnitude squared is .

Index Mode

When Mode is set to Index, the block computes the minimum value in each row or column of the input, along vectors of a specified dimension of the input, or of the entire input, and outputs the index array I. Each element in I is an integer indexing the minimum value in the corresponding column, row, vector, or entire input. The output I depends on the setting of the Find the minimum value over parameter. For example, consider a 3-dimensional input signal of size M-by-N-by-P:

When a minimum value occurs more than once, the computed index corresponds to the first occurrence. For example, when the input is the column vector [-1 2 3 2 -1]', the computed one-based index of the minimum value is 1 rather than 5 when Each column is selected.

Value and Index Mode

When Mode is set to Value and Index, the block outputs both the minima and the indices.

Running Mode

When Mode is set to Running, the block tracks the minimum value of each channel in a time sequence of M-by-N inputs. For sample-based inputs, the output is a sample-based M-by-N array with each element yij containing the minimum value observed in element uij for all inputs since the last reset. For frame-based inputs, the output is a frame-based M-by-N array with each element yij containing the minimum value observed in the jth column of 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 block is set to Running mode, each element of the N-D signal is considered as a separate channel. There are channels, where di is the size of the ith dimension.

Resetting the Running Minimum

The block resets the running minimum 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 minimum for each channel is initialized to the value in the corresponding channel of the current input. For frame-based inputs, the running minimum for each channel is initialized to the earliest value in each channel of the current input.

You specify the reset event by the Reset port parameter:

Fixed-Point Data Types

The parameters on the Fixed-point pane of the block dialog are only used for complex fixed-point inputs. The sum of the squares of the real and imaginary parts of such an input are formed before a comparison is made, as described in Value Mode. The results of the squares of the real and imaginary parts are placed into the product output data type. The result of the sum of the squares is placed into the accumulator data type. These parameters are ignored for other types of inputs.

Examples

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

The Minimum block has the following settings:

The Signal From Workspace block has the following settings:

where

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

The Discrete Impulse block has the following settings:

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

Dialog Box

The Main pane of the Minimum block dialog appears as follows.

Mode

Specify the block's mode of operation:

For more information, see Description.

Index base

Specify whether the index of the minimum value is reported using one-based or zero-based numbering. This parameter is only visible when the Mode parameter is set to Index or Value and index.

Find the minimum value over

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

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 minimum value of parameter is set to Each column.

Reset port

Specify the reset event detected at the RST input port when you select Running for the Mode parameter. The rate of the reset signal must be a positive integer multiple of the rate of the data signal input. This parameter is enabled only when you set the Mode parameter to Running. For information about the possible values of this parameter, see Resetting the Running Minimum.

Dimension

Specify the dimension (one-based value) of the input signal, over which the minimum 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 minimum value over parameter is set to Specified dimension.

The Fixed-point pane of the Minimum block dialog appears as follows.

Rounding mode

Select the rounding mode for fixed-point operations.

Overflow mode

Select the overflow mode for fixed-point operations.

Product output

Use this parameter to specify how you would like to designate the product output word and fraction lengths resulting from a complex-complex multiplication in the block. See Multiplication Data Types for more information:

Accumulator

Use this parameter to specify the accumulator word and fraction lengths resulting from a complex-complex multiplication in the block. See Multiplication Data Types for more information:

Lock scaling against changes by the autoscaling tool

Select this parameter to prevent any fixed-point scaling you specify in this block mask from being overridden by the autoscaling feature of the Fixed-Point Tool. See the fxptdlg reference page for more information.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

Reset

  • Double-precision floating point

  • Single-precision floating point

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

Idx

  • Double-precision floating point

  • 32-bit unsigned integers

Val

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

See Also

MaximumSignal Processing Blockset
MeanSignal Processing Blockset
MinMaxSimulink
HistogramSignal Processing Blockset
minMATLAB

  


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