SignalProcessing
CrossCorrelation
estimate the cross-correlation of two arrays containing samples
Calling Sequence
Parameters
Options
Description
Thread Safety
Examples
Compatibility
CrossCorrelation(A, B, lowerlag)
A, B
-
Arrays of real or complex numeric values; the signals
lowerlag
integer (optional) for the lower value (default is 0) of the range of lags at which the correlation estimates are computed
container : Array, predefined Array for holding result
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
Ck=∑i=1M⁡Ai&conjugate0;⁢Bk+i+lowerlag
for 1≤k and k≤M+N−1. Here, Bi is taken to be 0, for N<i.
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.
The SignalProcessing[CrossCorrelation] command is thread-safe as of Maple 17.
For more information on thread safety, see index/threadsafe.
with⁡SignalProcessing:
a≔GenerateUniform⁡10,−1,1
a≔0.9958675736749190.4083375294118190.167610888327636−0.2468588373222460.432866472071836−0.4399798582161470.4329013102693530.481379433115581−0.4776970633728260.0288390346482901
b≔GenerateUniform⁡7,−1,1
b≔−0.545369867754208−0.3261160447254520.6263739238191340.559925029969611−0.373917395136553−0.09195902641578850.819334052606265
CrossCorrelation⁡a,b
−0.476222338403256−0.2831385282059771.167114395502920.187253489989328−0.2725932223088070.2429858302900160.8159482149982400.0.0.0.0.0.0.0.0.
CrossCorrelation⁡a,b,0
CrossCorrelation⁡a,b,−9
−0.01572794051229700.251116712365011−0.0886811416019255−0.6761461737140310.1220412591554200.624073878396842−0.152173745069526−0.5836547502090530.329508750662104−0.476222338403256−0.2831385282059771.167114395502920.187253489989328−0.2725932223088070.2429858302900160.815948214998240
c≔Array⁡1..numelems⁡a+numelems⁡b−1,datatype=float8:
CrossCorrelation⁡a,b,container=c
c
The SignalProcessing[CrossCorrelation] command was introduced in Maple 17.
For more information on Maple 17 changes, see Updates in Maple 17.
See Also
SignalProcessing[AutoCorrelation]
SignalProcessing[Convolution]
Download Help Document