Download Help (Windows Only) |
Owning Class: statistics
Requires: MathScript RT Module
movavg(x, a, b)
movavg(x, a, b, alpha)
movavg(x, a, b, ‘e’)
short = movavg(x, a, b)
short = movavg(x, a, b, alpha)
short = movavg(x, a, b, ‘e’)
[short, long] = movavg(x, a, b)
[short, long] = movavg(x, a, b, alpha)
[short, long] = movavg(x, a, b, ‘e’)
Calculates the short-term and long-term moving average of an input signal. If you do not specify an output, this function plots the input signal, the long-term moving average, and the short-term moving average in the current plot window.
Name | Description |
---|---|
x | Specifies the input signal. x is a real, double-precision, floating-point scalar or vector. |
a | Specifies the averaging length for short-term moving average. a is a positive integer. |
b | Specifies the averaging length for long-term moving average. b is a positive integer, and b is larger than or equal to a. |
alpha | Specifies the weighting power of the delay. alpha is a real, double-precision, floating-point scalar. The default is 0. |
'e' | Specifies to calculate the exponential moving average. |
Name | Description |
---|---|
short | Returns the short-term moving average of the input signal. short is a real, double-precision, floating-point scalar or vector. |
long | Returns the long-term moving average of the input signal. long is a real, double-precision, floating-point scalar or vector. |
The following table lists the support characteristics of this function.
Supported in the LabVIEW Run-Time Engine | Yes (if you request output) |
Supported on RT targets | Yes (if you request output) |
Suitable for bounded execution times on RT | Not characterized |
X = [1 2 3 4 5]
[short, long] = movavg(X, 2, 4)