DSP System Toolbox / Statistics
The Moving Maximum block determines the moving maximum of the input signal along each channel independently over time. The block uses the sliding window method to determine the moving maximum. In this method, a window of specified length moves over each channel sample by sample, and the block determines the maximum over the data in the window. For more details, see Algorithms.
Port_1— Data input
Data over which the moving maximum is determined using the sliding window method. The block accepts real-valued or complex-valued multichannel inputs, that is, m-by-n size inputs, where m ≥ 1 and n ≥ 1. The block also accepts variable-size inputs. During simulation, you can change the size of each input channel. However, the number of channels cannot change.
Complex Number Support: Yes
Port_1— Moving maximum output
Moving maximum output, determined using the sliding window method. The size of the output matches the size of the input. The window slides column-wise along each channel, and the block determines the maximum of the data in the window. For more details, see Algorithms.
Complex Number Support: Yes
Specify window length— Flag to specify window length
When you select this check box, the length of the sliding window is equal to the value you specify through the Window length parameter. When you clear this check box, the length of the sliding window is infinite. In this mode, the block determines the maximum of the current sample and all previous samples in the channel.
Window length— Length of the sliding window
Window length specifies the length of the sliding window. This parameter appears when you select the Specify window length check box.
Simulate using— Type of simulation to run
Code generation(default) |
Simulate model using generated C code. The first time you run
a simulation, Simulink® generates C code for the block. The C code is
reused for subsequent simulations, as long as the model does not
change. This option requires additional startup time but
provides faster simulation speed
Simulate model using the MATLAB® interpreter. This option shortens startup
time but has slower simulation speed than
In the sliding window method, the output for each input sample is the maximum of the current sample and the Len - 1 previous samples. Len is the length of the window. When the algorithm computes the first Len - 1 outputs, the length of the window is the length of the data that is available.
When you do not specify the window length, the algorithm chooses an infinite window length. In this mode, the output is the maximum of the current sample and all the previous samples in the channel.
Consider an example of computing the moving maximum of a streaming input data using the sliding window method. The algorithm uses a window length of 4. With each input sample that comes in, the window of length 4 moves along the data.