Double1DCorrelation represents a 1D correlation, with a specified kernel and data length.

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 5.1.0.0

Syntax

C#
[SerializableAttribute]
public class Double1DCorrelation : CorrelationBase, 
	ICloneable
Visual Basic (Declaration)
<SerializableAttribute> _
Public Class Double1DCorrelation _
	Inherits CorrelationBase _
	Implements ICloneable
Visual C++
[SerializableAttribute]
public ref class Double1DCorrelation : public CorrelationBase, 
	ICloneable

Remarks

The length of the correlation = length_of_data + length_of_kernel - 1. In general, unlike convolution, correlation is a non-communitive operation. Typically the kernel is shorter than the data and is used over many correlations operations against different data sets. This class is designed to be used in that fashion and the higest performance will be acheived if the kernel is fixed over a series of correlation operations.

Examples

CopyC#
DoubleVector kernel = new DoubleVector(1, 2, 3, 1);
DoubleVector data = new DoubleVector(1, 2, 3, 4, 5, 6);

Double1DCorrelation corr = new Double1DCorrelation(kernel, data.Length);
DoubleVector correlation = corr.Correlate(data);

DoubleVector corr_full_kernel_overlap = corr.TrimConvolution(correlation, CorrelationBase.Windowing.FullKernelOverlap);
DoubleVector corr_centered = corr.TrimConvolution(correlation, CorrelationBase.Windowing.CenterWindow);

// correlation =            [1 5 11 18 25 32 32 17 6]
// corr_centered =              [11 18 25 32 32 17]
// corr_full_kernel_overlap =      [18 25 32]

Inheritance Hierarchy

System..::.Object
  CenterSpace.NMath.Core..::.CorrelationBase
    CenterSpace.NMath.Core..::.Double1DCorrelation

See Also