SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Convolution and Correlation Computations : SignalProcessing/AutoCorrelation

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 autocorrelation is defined by the formula

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

 for each $k$ from $1$ to $N$, with ${A}_{j}=0$ for $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}$.
 • Before the code performing the computation runs, Maple converts A to a hardware datatype, first attempting float and subsequently complex, 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.785218492150308}& {0.588413964957000}& {-0.993165822699668}& {0.921578288543971}& {-0.0387801709584892}& {0.0136057925410569}& {-0.210756972897798}& {0.749600215815009}& {0.138966357801110}& {0.212285134010017}\end{array}\right]$ (1)
 > $\mathrm{AutoCorrelation}\left(a\right)$
 $\left[\begin{array}{cccccccccc}{3.47086859901291}& {-2.02515410791538}& {1.52138859776280}& {-1.02612041612929}& {0.936087820441427}& {-0.759337256605807}& {0.664186241000468}& {-0.717664545354391}& {0.0157925834720547}& {-0.166690212833272}\end{array}\right]$ (2)
 > $c≔\mathrm{Array}\left(1..\mathrm{numelems}\left(a\right),'\mathrm{datatype}'={'\mathrm{float}'}_{8}\right):$
 > $\mathrm{AutoCorrelation}\left(a,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccc}{3.47086859901291}& {-2.02515410791538}& {1.52138859776280}& {-1.02612041612929}& {0.936087820441427}& {-0.759337256605807}& {0.664186241000468}& {-0.717664545354391}& {0.0157925834720547}& {-0.166690212833272}\end{array}\right]$ (3)
 > $c$
 $\left[\begin{array}{cccccccccc}{3.47086859901291}& {-2.02515410791538}& {1.52138859776280}& {-1.02612041612929}& {0.936087820441427}& {-0.759337256605807}& {0.664186241000468}& {-0.717664545354391}& {0.0157925834720547}& {-0.166690212833272}\end{array}\right]$ (4)
 > $\mathrm{AutoCorrelation}\left(a,'\mathrm{scaling}'='\mathrm{biased}'\right)$
 $\left[\begin{array}{cccccccccc}{0.347086865073288}& {-0.202515413809252}& {0.152138862043326}& {-0.102612043141967}& {0.0936087834390223}& {-0.0759337267920814}& {0.0664186250897614}& {-0.0717664556048426}& {0.00157925837073825}& {-0.0166690215317150}\end{array}\right]$ (5)
 > $\mathrm{AutoCorrelation}\left(a,'\mathrm{scaling}'='\mathrm{unbiased}','\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccc}{0.347086859901291}& {-0.225017123101709}& {0.190173574720350}& {-0.146588630875612}& {0.156014636740238}& {-0.151867451321161}& {0.166046560250117}& {-0.239221515118130}& {0.00789629173602734}& {-0.166690212833272}\end{array}\right]$ (6)
 > $c$
 $\left[\begin{array}{cccccccccc}{0.347086859901291}& {-0.225017123101709}& {0.190173574720350}& {-0.146588630875612}& {0.156014636740238}& {-0.151867451321161}& {0.166046560250117}& {-0.239221515118130}& {0.00789629173602734}& {-0.166690212833272}\end{array}\right]$ (7)

Compatibility

 • The SignalProcessing[AutoCorrelation] command was introduced in Maple 17.