Click or drag to resize

Float1DConvolution Class

Float1DConvolution represents a 1D convolution, with a specified kernel and data length.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreConvolutionBase
    CenterSpace.NMath.CoreFloat1DConvolution

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

The Float1DConvolution type exposes the following members.

Constructors
 NameDescription
Public methodFloat1DConvolution(FloatVector, Int32) Constructs a convolution instance and defines the convolution kernel, and input signal data length.
Public methodFloat1DConvolution(Single, Int32) Constructs a convolution instance and defines the convolution kernel, and input signal data length.
Public methodFloat1DConvolution(Single, Int32, Int32, Int32) Constructs a convolution instance and defines the convolution kernel with a given offset and stride.
Top
Properties
 NameDescription
Public propertyDataLength Gets the length of the convolution data.
(Inherited from ConvolutionBase)
Public propertyKernelLength Gets the length of the convolution kernel.
(Inherited from ConvolutionBase)
Public propertyKernelShape Gets the shape of the convolution kernel.
(Inherited from ConvolutionBase)
Public propertyLength Gets the length of the convolution.
(Inherited from ConvolutionBase)
Top
Methods
 NameDescription
Public methodClone Creates a deep copy of this convolution instance.
Public methodConvolve(FloatVector) Computes the convolution between the stored convolution kernel, and the vector data.
Public methodConvolve(Single) Computes the convolution between the stored convolution kernel, and the vector data.
Public methodConvolve(FloatVector, FloatVector) Computes the convolution between the stored convolution kernel, and the vector data.
Public methodConvolve(Single, Single) Computes the convolution between the stored convolution kernel, and the vector data.
Protected methodFinalize Provides non-deterministic destruction of underlying unmanaged resources.
(Inherited from ConvolutionBase)
Public methodTrimConvolution(FloatVector, ConvolutionBaseWindowing) Creates a clipped view into the convolution. This does not create a copy of the input convolution.
Protected methodTrimConvolutionT(T, ConvolutionBaseWindowing) Creates a windowed view into the convolution. This does not create a copy of the input convolution.
(Inherited from ConvolutionBase)
Top
Fields
 NameDescription
Protected fieldkerneloffset_ Convolution kernel offset.
(Inherited from ConvolutionBase)
Protected fieldkernelstride_ Convolution kernel stride.
(Inherited from ConvolutionBase)
Protected fieldmode_ Mode is either automatic, fft, or direct sum.
(Inherited from ConvolutionBase)
Top
Remarks
The convolution length = length_of_data + length_of_kernel - 1. Mathematically, the kernel and the input data can be interchanged without changing the convolution result. However, in practice, often the kernel is much shorter than the data and is used over many convolution 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 convolution operations.
Example
C#
// 1D Convolution example
// Moving average filter of length 5
   float[] kernel = { .2, .2, .2, .2, .2 };
   float[] data = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

   Float1DConvolution conv = new Float1DConvolution(kernel, data.Length);
   float[] z = new float[conv.Length];

   conv.Convolve(data, ref z);

// Now z contains the convolution result, z = kernel*data, of length 13.
See Also