Click or drag to resize

Double1DConvolution Class

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

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

The Double1DConvolution type exposes the following members.

Constructors
 NameDescription
Public methodDouble1DConvolution(Double, Int32) Constructs a convolution instance and defines the convolution kernel, and input signal data length.
Public methodDouble1DConvolution(DoubleVector, Int32) Constructs a convolution instance and defines the convolution kernel, and input signal data length.
Public methodDouble1DConvolution(Double, 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(Double) Computes the convolution between the stored convolution kernel, and the vector data.
Public methodConvolve(DoubleVector) Computes the convolution between the stored convolution kernel, and the vector data.
Public methodConvolve(Double, Double) Computes the convolution between the stored convolution kernel, and the vector data.
Public methodConvolve(DoubleVector, DoubleVector) 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(DoubleVector, 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
   double[] kernel = { .2, .2, .2, .2, .2 };
   double[] data = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

   Double1DConvolution conv = new Double1DConvolution(kernel, data.Length);
   double[] z = new double[conv.Length];

   conv.Convolve(data, ref z);

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