Median
The median of the input data.
blockType: Median
Path in the library:
|
Description
The Median block calculates the median of each row, column, or vector of a given dimension of the input data. The block can also calculate the median of the entire input signal. The dimension can be set using the parameters Find the median value over.
When calculating the median, the block first sorts the input values. If the number of values is odd, the median will be the middle value. If the number of values is even, the median will be the average of the two middle values.
Ports
Input
#
IN_1
—
input data
vector
| matrix
| array
Details
The block accepts multichannel and multidimensional input data with real or complex values.
Data types |
|
Complex numbers support |
Yes |
Output
#
OUT_1
—
average value of the specified measurement
vector
| matrix
Details
The block calculates the median value in each row or column of the input data, or along vectors of a given input data size. It can also compute the median of the entire input signal. Each element in the output array y is the median value of the corresponding column, row, or the entire input signal. The output array y
depends on the setting of the parameters Find the median value over.
Consider a three-dimensional input signal of size to to . When you set the parameters Find the median value over to:
-
Entire input
- The output at each computation step is a scalar containing the median value of the input matrix to to . -
Each row
- the output data at each calculation step consists of an array of dimension by1
by , where each element contains the median value of each vector on the second dimension of the input data. For an input matrix of dimension by , the output data will be a column vector by1
. -
Each column
- the output data at each calculation step consists of an array of dimension1
at at , where each element contains the median value of each vector along the first dimension of the input data. For an input matrix of dimension by , the output data will be the vector-row1
by .In this mode, the block processes the input data of undirected vectors of length as column vectors of dimension by
1
. -
Specified dimension
- The output data at each calculation step depends on the value of the parameters Dimension.-
If you set the parameter Dimension to
1
, the output data will be the same as when the value of theEach column
. -
If you set the parameter Dimension to
2
, the output will be the same as for the value of .Each row
. -
If you set the parameters Dimension to
3
, the output at each calculation step will be a matrix by , containing the median value of each vector along the third dimension of the input data.
-
The output data type corresponds to the input data type.
Data types |
|
Complex numbers support |
Yes |
Parameters
Main
#
Find the median value over —
the measurement from which the median is calculated
Entire input
| Each row
| Each column
| Specified dimension
Details
-
Each column
- block outputs the median value for each column. -
Each row
- block outputs the median value for each row. -
Entire input
- block outputs the median value for all input data. -
Specified dimension
- block outputs the median value for the measurement specified in the parameter Dimension.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Dimension —
dimensionality
Int64 integer
Details
Specify the dimension of the input signal from which the block calculates the median. The value of this parameters must be greater than 0
and less than or equal to the number of dimensions in the input signal.
Dependencies
To use this parameter, set the Find the median value over parameters to the value of Specified dimension
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |