Main Content

Cross-correlation of two inputs

The `dsp.Crosscorrelator`

System object™ computes the cross-correlation of two *N*-D input arrays along
the first dimension. The computation can be done in the time domain or frequency domain. You
can specify the domain through the Method property. In the time domain, the object convolves
the first input signal, *u*, with the time-reversed complex conjugate of the
second input signal, *v*. To compute the cross-correlation in the frequency
domain, the object:

Takes the Fourier transform of both input signals, resulting in

*U*and*V*.Multiplies

*U*and*V*, where * denotes the complex conjugate.^{*}Computes the inverse Fourier transform of the product.

If you set `Method`

to `'Fastest'`

, the
object chooses the domain that minimizes the number of computations. For information on these
computation methods, see Algorithms.

To obtain the cross-correlation for two discrete-time deterministic inputs:

Create the

`dsp.Crosscorrelator`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?.

returns a
cross-correlator object, `xcorr`

= dsp.Crosscorrelator`xcorr`

, that computes the cross-correlation of
two inputs in the time domain or frequency domain.

returns a cross-correlator object with each specified property set to the specified value.
Enclose each property name in single quotes.`xcorr`

= dsp.Crosscorrelator(`Name,Value`

)

To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named `obj`

, use
this syntax:

release(obj)