Documentation

dsp.MovingMinimum System object

Moving minimum

Description

Thedsp.MovingMinimumSystem 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算法.

该对象接受多通道输入,即m-经过-n大小输入,其中m≥ 1, andn> 1. The object also accepts variable-size inputs. Once the object is locked, you can change the size of each input channel. However, the number of channels cannot change. This object supports C and C++ code generation.

To determine the moving minimum of the input:

  1. 创建一个dsp.MovingMinimumobject and set the properties of the object.

  2. Callstep计算移动最小值。

不te

Alternatively, instead of using thestep方法进行加工ation defined by the System object, you can call the object with arguments, as if it were a function. For example,y = step(obj,x)y = obj(x)perform equivalent operations.

Construction

movMin = dsp.MovingMinimum返回移动最小对象,movMin, using the default properties.

movMin = dsp.MovingMinimum(Len)设置窗口长property to.

movMin = dsp.MovingMinimum(Name,Value)使用Name,Valuepairs. Unspecified properties have default values.

Example:

movMin = dsp.MovingMinimum('SpecifyWindowLength',1,'WindowLength',10);

Properties

expand all

Flag to specify a window length, specified as a scalar boolean.

  • 真的— The length of the sliding window is equal to the value you specify in the窗口长property.

  • false- 滑动窗口的长度是无限的。在此模式下,对象确定当前样品的最小值和过去的所有样品。

滑动窗口的长度,指定为正标性整数。设置此属性时适用SpecifyWindowLengthto真的.

方法

reset 重置内部状态System object
step 移动最小输入信号
Common to All System Objects
release

Allow System object property value changes

Examples

expand all

Compute the moving minimum of a sum of three sine waves with varying amplitude. Use a sliding window of length 30.

初始化

设置一个输入信号,该信号是三个正弦波的总和,频率为2 Hz,5 Hz和10 Hz。采样频率为100 Hz。创建一个dsp.MovingMinimumobject with a window length of 30. Create a time scope for viewing the output.

sin = dsp.SineWave('SampleRate', 100,...'频率',[2 5 10],...'SamplesPerFrame',100);movmin = dsp.movi​​ngminemine(30);范围= dsp.timescope('SampleRate', 100,...“ timespanoverrunaction”,'滚动',...'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 themovMinobject to determine the minimum value of the current sample and the past 29 samples of the input signal.

for索引= 1:100 sin.mplitude = rand(1,3);x = sum(sin(),2);xmin = movmin(x);范围([x,xmin])end

算法

expand all

参考

[1] Bodenham, Dean. “Adaptive Filtering and Change Detection for Streaming Data.” PH.D. Thesis. Imperial College, London, 2012.

Extended Capabilities

Introduced in R2016b

这个话题有帮助吗?