CrossCorrelation - Maple Help

# Online Help

###### All Products    Maple    MapleSim

SignalProcessing

 CrossCorrelation
 estimate the cross-correlation of two arrays containing samples

 Calling Sequence CrossCorrelation(A, B)

Parameters

 A, B - Arrays of real or complex numeric values; the signals lowerlag - integer for the lower value (default is 0) of the range of lags at which the correlation estimates are computed

Options

 • container : Array, predefined Array for holding result

Description

 • The CrossCorrelation(A, B) command estimates the cross-correlation of the Vectors A and B of length $M$ and $N$ respectively. An Array of length $M+N-1$ containing the result is returned.
 • The cross-correlation is defined by the formula

${C}_{k}={\sum }_{i=1}^{M}\stackrel{&conjugate0;}{{A}_{i}}{B}_{k+i+\mathrm{lowerlag}}$

 for $1\le k$ and $k\le M+N-1$. Here, ${B}_{i}$ is taken to be $0$, for $N.
 • Before the code performing the computation runs, Maple converts A and B to a hardware datatype, first attempting float[8] and subsequently complex[8], unless they already have one of these datatypes. For this reason, it is most efficient if they have one of these datatypes beforehand. The output will have the datatype that the computation is performed in.
 • 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 size $M+N-1$ having datatype float[8] if A and B are real, and complex[8] otherwise.

Thread Safety

 • The SignalProcessing[CrossCorrelation] command is thread-safe as of Maple 17.
 • For more information on thread safety, see index/threadsafe.

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)
 > $b≔\mathrm{GenerateUniform}\left(7,-1,1\right)$
 ${b}{≔}\left[\begin{array}{ccccccc}{-0.545369867754208}& {-0.326116044725452}& {0.626373923819134}& {0.559925029969611}& {-0.373917395136553}& {-0.0919590264157885}& {0.819334052606265}\end{array}\right]$ (2)
 > $\mathrm{CrossCorrelation}\left(a,b\right)$
 $\left[\begin{array}{cccccccccccccccc}{-0.476222338403256}& {-0.283138528205977}& {1.16711439550292}& {0.187253489989328}& {-0.272593222308807}& {0.242985830290016}& {0.815948214998240}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}\end{array}\right]$ (3)
 > $\mathrm{CrossCorrelation}\left(a,b,0\right)$
 $\left[\begin{array}{cccccccccccccccc}{-0.476222338403256}& {-0.283138528205977}& {1.16711439550292}& {0.187253489989328}& {-0.272593222308807}& {0.242985830290016}& {0.815948214998240}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}\end{array}\right]$ (4)
 > $\mathrm{CrossCorrelation}\left(a,b,-9\right)$
 $\left[\begin{array}{cccccccccccccccc}{-0.0157279405122970}& {0.251116712365011}& {-0.0886811416019255}& {-0.676146173714031}& {0.122041259155420}& {0.624073878396842}& {-0.152173745069526}& {-0.583654750209053}& {0.329508750662104}& {-0.476222338403256}& {-0.283138528205977}& {1.16711439550292}& {0.187253489989328}& {-0.272593222308807}& {0.242985830290016}& {0.815948214998240}\end{array}\right]$ (5)
 > $c≔\mathrm{Array}\left(1..\mathrm{numelems}\left(a\right)+\mathrm{numelems}\left(b\right)-1,'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{CrossCorrelation}\left(a,b,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccccccccc}{-0.476222338403256}& {-0.283138528205977}& {1.16711439550292}& {0.187253489989328}& {-0.272593222308807}& {0.242985830290016}& {0.815948214998240}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}\end{array}\right]$ (6)
 > $c$
 $\left[\begin{array}{cccccccccccccccc}{-0.476222338403256}& {-0.283138528205977}& {1.16711439550292}& {0.187253489989328}& {-0.272593222308807}& {0.242985830290016}& {0.815948214998240}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}& {0.}\end{array}\right]$ (7)

Compatibility

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

 See Also