Click or drag to resize

FloatComplex1DCorrelation Class

FloatComplex1DCorrelation represents a 1D correlation, with a specified kernel and data length.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreCorrelationBase
    CenterSpace.NMath.CoreFloatComplex1DCorrelation

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
[SerializableAttribute]
public class FloatComplex1DCorrelation : CorrelationBase, 
	ICloneable

The FloatComplex1DCorrelation type exposes the following members.

Constructors
 NameDescription
Public methodFloatComplex1DCorrelation(FloatComplex, Int32) Constructs a correlation instance and defines the correlation kernel, and input signal data length.
Public methodFloatComplex1DCorrelation(FloatComplexVector, Int32) Constructs a correlation instance and defines the correlation kernel, and input signal data length.
Public methodFloatComplex1DCorrelation(FloatComplex, Int32, Int32, Int32) Constructs a correlation instance and defines the correlation kernel with a given offset and stride.
Top
Properties
 NameDescription
Public propertyDataLength Gets the length of the correlation data.
(Inherited from CorrelationBase)
Public propertyKernelLength Gets the length of the correlation kernel.
(Inherited from CorrelationBase)
Public propertyKernelShape Gets the shape of the convolution kernel.
(Inherited from CorrelationBase)
Public propertyLength Gets the length of the correlation.
(Inherited from CorrelationBase)
Top
Methods
 NameDescription
Public methodClone Creates a deep copy of this correlation instance.
Public methodCorrelate(FloatComplex) Computes the correlation between the stored correlation kernel, and the vector data.
Public methodCorrelate(FloatComplexVector) Computes the correlation between the stored correlation kernel, and the vector data.
Public methodCorrelate(FloatComplex, FloatComplex) Computes the correlation between the stored correlation kernel, and the vector data.
Public methodCorrelate(FloatComplexVector, FloatComplexVector) Computes the correlation between the stored correlation kernel, and the vector data.
Public methodDispose Clean up resources.
(Inherited from CorrelationBase)
Protected methodFinalize Provides non-deterministic destruction of underlying unmanaged resources.
(Inherited from CorrelationBase)
Public methodTrimConvolution Creates a clipped view into the correlation. This does not create a copy of the input correlation.
Protected methodTrimCorrelationT Creates a windowed view into the correlation. This does not create a copy of the input correlation.
(Inherited from CorrelationBase)
Top
Fields
 NameDescription
Protected fieldkerneloffset_ Offset into correlation kernel.
(Inherited from CorrelationBase)
Protected fieldkernelstride_ Correlation kernel stride.
(Inherited from CorrelationBase)
Protected fieldmode_ Mode is either automatic, fft, or direct sum.
(Inherited from CorrelationBase)
Top
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.
Example
C#
FloatComplexVector kernel = new FloatComplexVector(1, 2, 3, 1);
FloatComplexVector data = new FloatComplexVector(1, 2, 3, 4, 5, 6);

FloatComplex1DCorrelation corr = new FloatComplex1DCorrelation(kernel, data.Length);
FloatComplexVector correlation = corr.Correlate(data);

FloatComplexVector corr_full_kernel_overlap = corr.TrimConvolution(correlation, CorrelationBase.Windowing.FullKernelOverlap);
FloatComplexVector 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]
See Also