object™ determines the moving minimum of the input signal along each channel,
independently over time. The object uses the sliding window method to determine the moving
minimum. In this method, a window of specified length is moved over each channel, sample by
sample, and the object determines the minimum of the data in the window. For more details, see
To determine the moving minimum of the input:
dsp.MovingMinimum object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects? (MATLAB).
returns a moving
movMin = dsp.MovingMinimum
movMin, using the default
movMin = dsp.MovingMinimum(
WindowLength property to
specifies additional properties using
movMin = dsp.MovingMinimum(
Name,Value pairs. Unspecified
properties have default values.
movMin = dsp.MovingMinimum('SpecifyWindowLength',1,'WindowLength',10);
Unless otherwise indicated, properties are nontunable, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
release function unlocks them.
If a property is tunable, you can change its value at any time.
For more information on changing property values, see System Design in MATLAB Using System Objects (MATLAB).
SpecifyWindowLength— Specify window length
Flag to specify a window length, specified as a scalar boolean.
true — The length of the sliding window is equal
to the value you specify in the
false — The length of the sliding window is
infinite. In this mode, the object determines the minimum of the current sample
and all the past samples.
WindowLength— Length of the sliding window
Length of the sliding window, specified as a positive scalar integer.
This property applies when you set
x— Data input
Data input, specified as a vector or a matrix. If
x is a
matrix, each column is treated as an independent channel. The moving minimum is
determined along each channel. The object also accepts variable-size inputs. Once the
object is locked, you can change the size of each input channel, but you cannot change
the number of channels.
y— Moving minimum output
Moving minimum output, returned as a vector or a matrix.
To use an object function, specify the
object as the first input argument. For
example, to release system resources of a System
Compute the moving minimum of a sum of three sine waves with varying amplitude. Use a sliding window of length 30.
Set up an input signal that is a sum of three sine waves with frequencies at 2 Hz, 5 Hz, and 10 Hz. The sampling frequency is 100 Hz. Create a
dsp.MovingMinimum object with a window length of 30. Create a time scope for viewing the output.
sin = dsp.SineWave('SampleRate',100,... 'Frequency',[2 5 10],... 'SamplesPerFrame',100); movMin = dsp.MovingMinimum(30); scope = dsp.TimeScope('SampleRate',100,... 'TimeSpanOverrunAction','Scroll',... 'TimeSpan',10,'ShowGrid',true,... 'YLimits',[-4.5 4.5]);
Compute the Moving Minimum
Each sine wave component of the input signal has a different amplitude that varies with the iteration. Use the
movMin object to determine the minimum value of the current sample and the past 29 samples of the input signal.
for index = 1:100 sin.Amplitude = rand(1,3); x = sum(sin(),2); xmin = movMin(x); scope([x,xmin]) end
In the sliding window method, the output for each input sample is the minimum 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 minimum of the current sample and all the previous samples in the channel.
Consider an example of computing the moving minimum 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.
 Bodenham, Dean. “Adaptive Filtering and Change Detection for Streaming Data.” PH.D. Thesis. Imperial College, London, 2012.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).