Fft<T>.ForwardTransform Method

Definition

Namespace: Numerics.NET.SignalProcessing
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0

Overload List

ForwardTransform(Vector<T>) Computes the discrete Fourier transform of a real signal and returns the result.
ForwardTransform(Vector<Complex<T>>) Computes the discrete Fourier transform of a complex signal and returns the result.
ForwardTransform(ArraySlice<T>, ArraySlice<Complex<T>>) Computes the discrete Fourier transform of a real signal.
ForwardTransform(ArraySlice<Complex<T>>, ArraySlice<Complex<T>>) Computes the discrete Fourier transform of a complex signal.
ForwardTransform(DenseVector<T>, ComplexConjugateSignalVector<T>) Computes the discrete Fourier transform of a real signal.
ForwardTransform(DenseVector<Complex<T>>, DenseVector<Complex<T>>) Computes the discrete Fourier transform of a complex signal.
ForwardTransform(Vector<T>, Vector<Complex<T>>) Computes the discrete Fourier transform of a real signal.
ForwardTransform(Vector<Complex<T>>, Vector<Complex<T>>) Computes the discrete Fourier transform of a complex signal.
ForwardTransform(Vector<T>, Vector<Complex<T>>, RealFftFormat) Computes the discrete Fourier transform of a real signal.
ForwardTransform(ReadOnlySpan<T>, Int32, Span<Complex<T>>, Int32) Computes the discrete Fourier transform of a real signal.
ForwardTransform(ReadOnlySpan<Complex<T>>, Int32, Span<Complex<T>>, Int32) Computes the discrete Fourier transform of a complex signal.

ForwardTransform(Vector<T>)

Computes the discrete Fourier transform of a real signal and returns the result.
C#
public ComplexConjugateSignalVector<T> ForwardTransform(
	Vector<T> input
)

Parameters

input  Vector<T>
A Double vector containing the input signal.

Return Value

ComplexConjugateSignalVector<T>
A ComplexConjugateSignalVector<T>.

Remarks

The output is stored in a compact format to take advantage of the symmetry properties of a real Fourier transform. Specifically, the return value stores only the first n/2+1 terms of the transformed signal.

Exceptions

ArgumentNullException

input is null.

ForwardTransform(Vector<Complex<T>>)

Computes the discrete Fourier transform of a complex signal and returns the result.
C#
public DenseVector<Complex<T>> ForwardTransform(
	Vector<Complex<T>> input
)

Parameters

input  Vector<Complex<T>>
On input, a complex vector containing the input signal. On return, the forward transform of the input.

Return Value

DenseVector<Complex<T>>

Exceptions

ArgumentNullException

input is null.

ForwardTransform(ArraySlice<T>, ArraySlice<Complex<T>>)

Computes the discrete Fourier transform of a real signal.
C#
public void ForwardTransform(
	ArraySlice<T> input,
	ArraySlice<Complex<T>> output
)

Parameters

input  ArraySlice<T>
A real array slice containing the input signal.
output  ArraySlice<Complex<T>>
A complex array slice to hold the transformed signal.

Remarks

The output is stored in a compact format to take advantage of the symmetry properties of a real Fourier transform. Specifically, output contains only the first n/2+1 terms of the transformed signal. Use the complex ArraySlice<T> class to obtain a complex vector that represents the complete signal.

Exceptions

InvalidOperationException

The Fourier transform implementation is not configured to accept real input.

ArgumentNullException

input is null.

-or-

output is null.

DimensionMismatchException

The length of input does not equal the length of output.

ForwardTransform(ArraySlice<Complex<T>>, ArraySlice<Complex<T>>)

Computes the discrete Fourier transform of a complex signal.
C#
public void ForwardTransform(
	ArraySlice<Complex<T>> input,
	ArraySlice<Complex<T>> output
)

Parameters

input  ArraySlice<Complex<T>>
A complex ArraySlice<T> containing the input signal.
output  ArraySlice<Complex<T>>
A complex ArraySlice<T> to hold the transformed signal.

Exceptions

ArgumentNullException

input is null.

-or-

output is null.

DimensionMismatchException

The length of input does not equal the length of output.

ForwardTransform(DenseVector<T>, ComplexConjugateSignalVector<T>)

Computes the discrete Fourier transform of a real signal.
C#
public void ForwardTransform(
	DenseVector<T> input,
	ComplexConjugateSignalVector<T> output
)

Parameters

input  DenseVector<T>
A Double vector containing the input signal.
output  ComplexConjugateSignalVector<T>
A complex vector to hold the transformed signal.

Remarks

The output is stored in a compact format to take advantage of the symmetry properties of a real Fourier transform. Specifically, output contains only the first n/2+1 terms of the transformed signal. Use the ComplexConjugateSignalVector<T> class to obtain a complex vector that represents the complete signal.

Exceptions

InvalidOperationException

The Fourier transform implementation is not configured to accept real input.

ArgumentNullException

input is null.

-or-

output is null.

DimensionMismatchException

The length of input does not equal the length of output.

ForwardTransform(DenseVector<Complex<T>>, DenseVector<Complex<T>>)

Computes the discrete Fourier transform of a complex signal.
C#
public void ForwardTransform(
	DenseVector<Complex<T>> input,
	DenseVector<Complex<T>> output
)

Parameters

input  DenseVector<Complex<T>>
A dense complex vector containing the input signal.
output  DenseVector<Complex<T>>
A dense complex vector to hold the transformed signal.

Exceptions

ArgumentNullException

input is null.

-or-

output is null.

DimensionMismatchException

The length of input does not equal the length of output.

ForwardTransform(Vector<T>, Vector<Complex<T>>)

Computes the discrete Fourier transform of a real signal.
C#
public void ForwardTransform(
	Vector<T> input,
	Vector<Complex<T>> output
)

Parameters

input  Vector<T>
A Double vector containing the input signal.
output  Vector<Complex<T>>
A complex vector to hold the transformed signal.

Remarks

The output is stored in a compact format to take advantage of the symmetry properties of a real Fourier transform. Specifically, output contains only the first n/2+1 terms of the transformed signal. Use the ComplexConjugateSignalVector<T> class to obtain a complex vector that represents the complete signal.

Exceptions

ArgumentNullException

input is null.

-or-

output is null.

ForwardTransform(Vector<Complex<T>>, Vector<Complex<T>>)

Computes the discrete Fourier transform of a complex signal.
C#
public void ForwardTransform(
	Vector<Complex<T>> input,
	Vector<Complex<T>> output
)

Parameters

input  Vector<Complex<T>>
A complex vector containing the input signal.
output  Vector<Complex<T>>
A complex vector to hold the transformed signal.

Exceptions

ArgumentNullException

input is null.

-or-

output is null.

ForwardTransform(Vector<T>, Vector<Complex<T>>, RealFftFormat)

Computes the discrete Fourier transform of a real signal.
C#
public void ForwardTransform(
	Vector<T> input,
	Vector<Complex<T>> output,
	RealFftFormat outputFormat
)

Parameters

input  Vector<T>
A Double vector containing the input signal.
output  Vector<Complex<T>>
A complex vector to hold the transformed signal.
outputFormat  RealFftFormat
A RealFftFormat value that specifies whether to return a one-sided or a two-sided transform.

Remarks

Use this method to compute the Fourier transform of a real signal. The outputFormat specifies whether the return value should contain the full complex transform (TwoSided), or only the first n/2+1 terms of the transformed signal (OneSided), where n is the length of the transform.

Exceptions

InvalidOperationException

The Fourier transform implementation is not configured to accept real input.

ArgumentNullException

input is null.

-or-

output is null.

ArgumentOutOfRangeException

outputFormat is not a valid RealFftFormat value.

DimensionMismatchException

outputFormat equals OneSided and the length of output does not equal half the length of input plus one.

-or-

outputFormat equals TwoSided and the length of input does not equal the length of output.

ForwardTransform(ReadOnlySpan<T>, Int32, Span<Complex<T>>, Int32)

Computes the discrete Fourier transform of a real signal.
C#
public abstract void ForwardTransform(
	ReadOnlySpan<T> input,
	int inputStride,
	Span<Complex<T>> output,
	int outputStride
)

Parameters

input  ReadOnlySpan<T>
A real span containing the input signal.
inputStride  Int32
The distance between successive elements in input.
output  Span<Complex<T>>
A complex span to hold the transformed signal.
outputStride  Int32
The distance between successive elements in output.

Remarks

The output is stored in a compact format to take advantage of the symmetry properties of a real Fourier transform. Specifically, output contains only the first n/2+1 terms of the transformed signal. Use the complex Span<T> class to obtain a complex vector that represents the complete signal.

Exceptions

InvalidOperationException

The Fourier transform implementation is not configured to accept real input.

ArgumentNullException

input is null.

-or-

output is null.

DimensionMismatchException

The length of input does not equal the length of output.

ForwardTransform(ReadOnlySpan<Complex<T>>, Int32, Span<Complex<T>>, Int32)

Computes the discrete Fourier transform of a complex signal.
C#
public abstract void ForwardTransform(
	ReadOnlySpan<Complex<T>> input,
	int inputStride,
	Span<Complex<T>> output,
	int outputStride
)

Parameters

input  ReadOnlySpan<Complex<T>>
A complex Span<T> containing the input signal.
inputStride  Int32
The distance between successive elements in input.
output  Span<Complex<T>>
A complex Span<T> to hold the transformed signal.
outputStride  Int32
The distance between successive elements in output.

Exceptions

ArgumentNullException

input is null.

-or-

output is null.

DimensionMismatchException

The length of input does not equal the length of output.

See Also