SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Filtering : SignalProcessing/MovingAverage

SignalProcessing

 MovingAverage
 apply a moving average filter to a signal

 Calling Sequence MovingAverage( A, n )

Parameters

 A - Array of real numeric values; the signal n - posint, size of the moving average filter

Options

 • container : Array, predefined Array for holding results

Description

 • The MovingAverage( A, n ) command applies a moving average filter of length n to a signal sample A, and returns its result as an Array with datatype float[8] of length numelems(A) - n.
 • Before the code performing the computation runs, A is converted to datatype float[8] if it does not have that datatype already. For this reason, it is most efficient if A has this datatype beforehand.
 • If the container=C option is provided, then the results are put into C and C is returned. In that case, the container C must have datatype float[8] and size numelems( A ) - n.

 • The SignalProcessing[MovingAverage] command is thread-safe as of Maple 18.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $A≔\mathrm{GenerateTone}\left(100,1,\frac{1}{\mathrm{Pi}},\mathrm{Pi}\right):$
 > $t≔\mathrm{MovingAverage}\left(A,20\right):$
 > $\mathrm{sP}≔\mathrm{plots}:-\mathrm{listplot}\left(A\right):$
 > $\mathrm{tP}≔\mathrm{plots}:-\mathrm{listplot}\left(t\right):$
 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{Array}\left(\left[\mathrm{sP},\mathrm{tP}\right]\right)\right)$

 > 

Compatibility

 • The SignalProcessing[MovingAverage] command was introduced in Maple 18.