AutoCorrelation - Maple Help

SignalProcessing

 AutoCorrelation
 estimate the autocorrelation of an array of samples

 Calling Sequence AutoCorrelation(A)

Parameters

 A - Array with complex or real numeric values; the signal

Options

 • container : Array, predefined Array for holding result
 • scaling : none, biased or unbiased

Description

 • The AutoCorrelation(A) command estimates the autocorrelation of the Array A of length $N$, storing the result in an Array C having the same length, which is then returned.
 • The un-scaled autocorrelation of Array A of length $N$ and initial index 1 is defined by the formula

${C}_{k}={\sum }_{i=1}^{N-k+1}\stackrel{&conjugate0;}{{A}_{i}}{A}_{i+k-1}$

 for each $k$ from $1$ to $N$. Note that this routine computes estimates for positive lags only, since the autocorrelation for a negative lag value is the complex conjugate of the autocorrelation for the equivalent positive lag.
 • The formula shown above is for the default value of the scaling option, none. If scaling is set to biased, then each value of C is scaled by $\frac{1}{N}$. If scaling is set to unbiased, then the $k$-th element of C is scaled by $\frac{1}{N-k+1}$.
 • Before the code performing the computation runs, Maple converts A to a hardware datatype, first attempting float[8] and subsequently complex[8], unless it already has one of these datatypes. For this reason, it is most efficient if A has one of these datatypes beforehand.
 • If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array of the same size and datatype as A.

 • The SignalProcessing[AutoCorrelation] command is thread-safe as of Maple 17.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $a≔\mathrm{GenerateUniform}\left(10,-1,1\right)$
 ${a}{≔}\left[\begin{array}{cccccccccc}{0.995867573674919}& {0.408337529411819}& {0.167610888327636}& {-0.246858837322246}& {0.432866472071836}& {-0.439979858216147}& {0.432901310269353}& {0.481379433115581}& {-0.477697063372826}& {0.0288390346482901}\end{array}\right]$ (1)
 > $\mathrm{AutoCorrelation}\left(a\right)$
 $\left[\begin{array}{cccccccccc}{2.27663599328728}& {-0.0894016848480742}& {0.0299606127962389}& {0.181340544436337}& {-0.0143240359417695}& {-0.0503001951032364}& {0.540491266220517}& {0.289162265624793}& {-0.463946955293826}& {0.0287198594623196}\end{array}\right]$ (2)
 > $c≔\mathrm{Array}\left(1..\mathrm{numelems}\left(a\right),'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{AutoCorrelation}\left(a,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccc}{2.27663599328728}& {-0.0894016848480742}& {0.0299606127962389}& {0.181340544436337}& {-0.0143240359417695}& {-0.0503001951032364}& {0.540491266220517}& {0.289162265624793}& {-0.463946955293826}& {0.0287198594623196}\end{array}\right]$ (3)
 > $c$
 $\left[\begin{array}{cccccccccc}{2.27663599328728}& {-0.0894016848480742}& {0.0299606127962389}& {0.181340544436337}& {-0.0143240359417695}& {-0.0503001951032364}& {0.540491266220517}& {0.289162265624793}& {-0.463946955293826}& {0.0287198594623196}\end{array}\right]$ (4)
 > $\mathrm{AutoCorrelation}\left(a,'\mathrm{scaling}'='\mathrm{biased}'\right)$
 $\left[\begin{array}{cccccccccc}{0.227663602721180}& {-0.00894016861802631}& {0.00299606132426868}& {0.0181340547138522}& {-0.00143240361552143}& {-0.00503001958527677}& {0.0540491274274465}& {0.0289162269933646}& {-0.0463946962207174}& {0.00287198598902788}\end{array}\right]$ (5)
 > $\mathrm{AutoCorrelation}\left(a,'\mathrm{scaling}'='\mathrm{unbiased}','\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccc}{0.227663599328728}& {-0.00993352053867491}& {0.00374507659952986}& {0.0259057920623339}& {-0.00238733932362825}& {-0.0100600390206473}& {0.135122816555129}& {0.0963874218749309}& {-0.231973477646913}& {0.0287198594623196}\end{array}\right]$ (6)
 > $c$
 $\left[\begin{array}{cccccccccc}{0.227663599328728}& {-0.00993352053867491}& {0.00374507659952986}& {0.0259057920623339}& {-0.00238733932362825}& {-0.0100600390206473}& {0.135122816555129}& {0.0963874218749309}& {-0.231973477646913}& {0.0287198594623196}\end{array}\right]$ (7)

Compatibility

 • The SignalProcessing[AutoCorrelation] command was introduced in Maple 17.
 • For more information on Maple 17 changes, see Updates in Maple 17.