Ocean
Ocean::FourierTransformation Class Reference

This class implements Fourier transformation functions. More...

Data Structures

class  NaiveImplementation
 This class provides the implementation of the Fourier transformation of the Ocean framework. More...
 

Static Public Member Functions

static bool dft0 (const Frame &source, Frame &target, int flags, int nonzero_rows)
 Direct Fourier Transformation (OpenCV-compatible interface) More...
 
static bool dft0 (const void *source, const unsigned int width, const unsigned int height, const unsigned int sourceChannels, void *target, const unsigned int targetChannels, const Ocean::FrameType::DataType dataType, int flags, int nonzero_rows, const unsigned int sourcePaddingElements=0u, const unsigned int targetPaddingElements=0u)
 Direct Fourier Transformation (OpenCV-compatible interface) More...
 
static int getOptimalDFTSize0 (int size)
 Returns the optimal DFT size for a given vector size. More...
 
template<typename T >
static void spatialToFrequency2 (const T *spatial, const unsigned int width, const unsigned int height, T *complexFrequency, const unsigned int spatialPaddingElements=0u, const unsigned int frequencyPaddingElements=0u)
 Applies a forward Fourier transformation for a given 2D (real) spatial signal. More...
 
template<typename T >
static void complexSpatialToFrequency2 (const T *complexSpatial, const unsigned int width, const unsigned int height, T *complexFrequency, const unsigned int spatialPaddingElements=0u, const unsigned int frequencyPaddingElements=0u)
 Applies a forward Fourier transformation for a given 2D (complex) spatial signal. More...
 
template<typename T >
static void frequencyToSpatial2 (const T *complexFrequency, const unsigned int width, const unsigned int height, T *spatial, const unsigned int frequencyPaddingElements=0u, const unsigned int spatialPaddingElements=0u)
 Applies a backward Fourier transformation for a given 2D frequency signal. More...
 
template<typename T >
static void frequencyToComplexSpatial2 (const T *complexFrequency, const unsigned int width, const unsigned int height, T *complexSpatial, const unsigned int frequencyPaddingElements=0u, const unsigned int spatialPaddingElements=0u)
 Applies a backward Fourier transformation for a given 2D frequency signal. More...
 
template<typename TScalar , typename TComplex >
static void scalarToComplex (const TScalar *source, std::complex< TComplex > *target, const size_t number)
 Converts scalar values to complex values. More...
 
template<typename TComplex , typename TScalar >
static void realToScalar (const std::complex< TComplex > *source, TScalar *target, const size_t number)
 Converts the real components of complex values to scalar values. More...
 
template<typename TComplex , typename TScalar >
static void imaginaryToScalar (const std::complex< TComplex > *source, TScalar *target, const size_t number)
 Converts the imaginary components of complex values to scalar values. More...
 
template<typename TComplex , typename TScalar >
static void complexToMagnitude (const std::complex< TComplex > *source, TScalar *target, const size_t number)
 Converts complex values to magnitude (or absolute) values. More...
 
template<typename T >
static void shiftHalfDimension2 (const T *source, unsigned int width, const unsigned int height, T *target)
 Shifts a given signal by half of the width and the height. More...
 
template<typename T >
static void shiftHalfDimension2 (T *data, unsigned int width, const unsigned int height)
 Shifts a given signal by half of the width and the height. More...
 
static unsigned int shiftCenter (const unsigned int size)
 Returns the center position for shift operations that corresponds with the first Fourier element. More...
 
template<typename T , bool tComplexConjugateA, bool tComplexConjugateB>
static void elementwiseMultiplication2 (const T *complexSourceA, const T *complexSourceB, T *complexTarget, const unsigned int width, const unsigned int height, const unsigned int horizontalPaddingSourceAElements=0u, const unsigned int horizontalPaddingSourceBElements=0u, const unsigned int horizontalPaddingTargetElements=0u)
 Elementwise multiplication of two 2D complex Fourier spectrums (one channel spectrums). More...
 
template<typename TComplex , bool tComplexConjugateA, bool tComplexConjugateB, typename TIntermediate = double>
static void elementwiseMultiplicationCCS (const TComplex *sourceA, const TComplex *sourceB, TComplex *target, const unsigned int width, const unsigned int height, const unsigned int horizontalPaddingSourceAElements=0u, const unsigned int horizontalPaddingSourceBElements=0u, const unsigned int horizontalPaddingTargetElements=0u)
 Multiplication of two 2D complex Fourier spectrums (one channel spectrums) in packed complex conjugate-symmetric format or CCS-packed format. More...
 
template<typename T >
static void elementwiseDivision2 (const T *complexSourceA, const T *complexSourceB, T *complexTarget, const unsigned int width, const unsigned int height, const unsigned int horizontalPaddingSourceAElements=0u, const unsigned int horizontalPaddingSourceBElements=0u, const unsigned int horizontalPaddingTargetElements=0u)
 Elementwise division of two 2D complex Fourier spectrums (one channel spectrums). More...
 

Detailed Description

This class implements Fourier transformation functions.

Member Function Documentation

◆ complexSpatialToFrequency2()

template<typename T >
static void Ocean::FourierTransformation::complexSpatialToFrequency2 ( const T *  complexSpatial,
const unsigned int  width,
const unsigned int  height,
T *  complexFrequency,
const unsigned int  spatialPaddingElements = 0u,
const unsigned int  frequencyPaddingElements = 0u 
)
static

Applies a forward Fourier transformation for a given 2D (complex) spatial signal.

Parameters
complexSpatialThe complex 2D spatial signal that will be transformed, must be valid
widthThe width of the 2D signal in elements, with range [1, infinity)
heightheight of the 2D signal in elements, with range [1, infinity)
complexFrequencyResulting complex frequency analysis for the given signal, must be valid
spatialPaddingElementsThe number of padding elements at the end of each row of the spatial signal, in elements with respect to T (not complex<T>), with range [0, infinity)
frequencyPaddingElementsThe number of padding elements at the end of each row of the frequency analysis, in elements (not complex<T>), with range [0, infinity)
Template Parameters
TData type of the spatial and frequency signals, either 'float' or 'double'

◆ complexToMagnitude()

template<typename TComplex , typename TScalar >
void Ocean::FourierTransformation::complexToMagnitude ( const std::complex< TComplex > *  source,
TScalar *  target,
const size_t  number 
)
inlinestatic

Converts complex values to magnitude (or absolute) values.

The magnitude of a complex value is determined by the square root of the squared sum of the real and the imaginary element.

Parameters
sourceComplex source values
targetResulting magnitude values, make sure that the provided memory is large enough
numberNumber of elements that will be converted
Template Parameters
TComplexData type of the complex signal
TScalarData type of the real signal

◆ dft0() [1/2]

static bool Ocean::FourierTransformation::dft0 ( const Frame source,
Frame target,
int  flags,
int  nonzero_rows 
)
static

Direct Fourier Transformation (OpenCV-compatible interface)

See also
cv::dft()
Parameters
sourceInput array that could be real or complex. Must be valid.
targetOutput array whose size and type depends on the flags. Size depends on flags.
flagsTransformation flags, representing a combination of the cv::DftFlags
nonzero_rowsNumber of nonzero rows. All rows after that will be ignored.
Returns
True on success, otherwise false

◆ dft0() [2/2]

static bool Ocean::FourierTransformation::dft0 ( const void *  source,
const unsigned int  width,
const unsigned int  height,
const unsigned int  sourceChannels,
void *  target,
const unsigned int  targetChannels,
const Ocean::FrameType::DataType  dataType,
int  flags,
int  nonzero_rows,
const unsigned int  sourcePaddingElements = 0u,
const unsigned int  targetPaddingElements = 0u 
)
static

Direct Fourier Transformation (OpenCV-compatible interface)

See also
cv::dft()
Parameters
sourceInput array that could be real or complex, must be a valid pointer
widthThe width of the input and output arrays, range: [1, infinity)
heightThe height of the input and output arrays, range: [1, infinity)
sourceChannelsNumber of channels of the input array, range: [1, 2]
targetOutput array, this must be initialized before calling this function, size depends on flags, must be a valid pointer
targetChannelsNumber of channels of the output array, depends on flags, range: [1, 2]
dataTypeData type of the input and output (must be the same), valid values: FrameType::DT_SIGNED_FLOAT_32 or FrameType::DT_SIGNED_FLOAT_64
flagsTransformation flags, representing a combination of the cv::DftFlags
nonzero_rowsNumber of nonzero rows. All rows after that will be ignored
sourcePaddingElementsNumber of padding elements used in the input array, range: [0, infinity)
targetPaddingElementsNumber of padding elements used in the output array, range: [0, infinity)
Returns
True on success, otherwise false

◆ elementwiseDivision2()

template<typename T >
void Ocean::FourierTransformation::elementwiseDivision2 ( const T *  complexSourceA,
const T *  complexSourceB,
T *  complexTarget,
const unsigned int  width,
const unsigned int  height,
const unsigned int  horizontalPaddingSourceAElements = 0u,
const unsigned int  horizontalPaddingSourceBElements = 0u,
const unsigned int  horizontalPaddingTargetElements = 0u 
)
static

Elementwise division of two 2D complex Fourier spectrums (one channel spectrums).

This function allows the definition of padding elements at the end of each row to support sub-specturms.

Parameters
complexSourceAThe pointer of the first source spectrum, must be valid
complexSourceBThe pointer of the second source spectrum, must be valid
complexTargetThe pointer of the targt spectrum receiving the elementwise multiplication result, must be valid
widthThe width of the 2D spectrum (the number of complex elements in horizontal direction), with range [1, infinity)
heightThe height of the 2D specturm (the number of complex elements in vertical direction), with range [1, infinity)
horizontalPaddingSourceAElementsOptional horizontal padding at the end of each row of the first source specturm, in elements with respect to T (not complex<T>), with range [0, infinity)
horizontalPaddingSourceBElementsOptional horizontal padding at the end of each row of the second source specturm, in elements with respect to T (not complex<T>), with range [0, infinity)
horizontalPaddingTargetElementsOptional horizontal padding at the end of each row of the target specturm, in elements with respect to T (not complex<T>), with range [0, infinity)
Template Parameters
TThe data type of the real and imaginary part of the complex number, e.g., 'float' or 'double'

◆ elementwiseMultiplication2()

template<typename T , bool tComplexConjugateA, bool tComplexConjugateB>
void Ocean::FourierTransformation::elementwiseMultiplication2 ( const T *  complexSourceA,
const T *  complexSourceB,
T *  complexTarget,
const unsigned int  width,
const unsigned int  height,
const unsigned int  horizontalPaddingSourceAElements = 0u,
const unsigned int  horizontalPaddingSourceBElements = 0u,
const unsigned int  horizontalPaddingTargetElements = 0u 
)
static

Elementwise multiplication of two 2D complex Fourier spectrums (one channel spectrums).

Parameters
complexSourceAThe pointer of the first complex source spectrum, must be valid
complexSourceBThe pointer of the second complex source spectrum, must be valid
complexTargetThe pointer of the target spectrum receiving the elementwise multiplication result, must be valid
widthThe width of the 2D spectrum (the number of complex elements in horizontal direction), with range [1, infinity)
heightThe height of the 2D specturm (the number of complex elements in vertical direction), with range [1, infinity)
horizontalPaddingSourceAElementsOptional horizontal padding at the end of each row of the first source specturm, in elements with respect to T (not complex<T>), with range [0, infinity)
horizontalPaddingSourceBElementsOptional horizontal padding at the end of each row of the second source specturm, in elements with respect to T (not complex<T>), with range [0, infinity)
horizontalPaddingTargetElementsOptional horizontal padding at the end of each row of the target specturm, in elements with respect to T (not complex<T>), with range [0, infinity)
Template Parameters
TThe data type of the real and imaginary part of the complex number, e.g., 'float' or 'double'
tComplexConjugateATrue, to multiply the complex conjugated values of the first spectrum; False, to multiply the first spectrum without modification
tComplexConjugateBTrue, to multiply the complex conjugated values of the first spectrum; False, to multiply the second spectrum without modification

◆ elementwiseMultiplicationCCS()

template<typename TComplex , bool tComplexConjugateA, bool tComplexConjugateB, typename TIntermediate >
void Ocean::FourierTransformation::elementwiseMultiplicationCCS ( const TComplex *  sourceA,
const TComplex *  sourceB,
TComplex *  target,
const unsigned int  width,
const unsigned int  height,
const unsigned int  horizontalPaddingSourceAElements = 0u,
const unsigned int  horizontalPaddingSourceBElements = 0u,
const unsigned int  horizontalPaddingTargetElements = 0u 
)
static

Multiplication of two 2D complex Fourier spectrums (one channel spectrums) in packed complex conjugate-symmetric format or CCS-packed format.

For 2D one-channel data, the packed conjugate-symmetric format (CCS-packed format) is defined as follows:

  1. Even width, \(w = 2L\), and even height, \(h = 2K\)

    \[\begin{bmatrix} R_{0,0} & R_{0,1} & I_{0,1} & R_{0,2} & \cdots & I_{0,L-1} & R_{0,L} \\ R_{1,0} & R_{1,1} & I_{1,1} & R_{1,2} & \cdots & I_{1,L-1} & R_{1,L} \\ I_{1,0} & R_{2,1} & I_{2,1} & R_{2,2} & \cdots & I_{2,L-1} & I_{1,L} \\ R_{2,0} & R_{3,1} & I_{3,1} & R_{3,2} & \cdots & I_{3,L-1} & R_{2,L} \\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \\ I_{K-1,0} & R_{2K-2,1} & I_{2K-2,1} & R_{2K-2,2} & \cdots & I_{2K-2,L-1} & I_{K-1,L} \\ R_{K,0} & R_{2K-1,1} & I_{2K-1,1} & R_{2K-1,2} & \cdots & I_{2K-1,L-1} & R_{K-1,L} \\ \end{bmatrix}\in\mathbb{R}^{h \times w}\]

  2. Even width, \(w = 2L\), and odd height, \(h = 2K + 1\)

    \[\begin{bmatrix} R_{0,0} & R_{0,1} & I_{0,1} & R_{0,2} & \cdots & I_{0,L-1} & R_{0,L} \\ R_{1,0} & R_{1,1} & I_{1,1} & R_{1,2} & \cdots & I_{1,L-1} & R_{1,L} \\ I_{1,0} & R_{2,1} & I_{2,1} & R_{2,2} & \cdots & I_{2,L-1} & I_{1,L} \\ R_{2,0} & R_{3,1} & I_{3,1} & R_{3,2} & \cdots & I_{3,L-1} & R_{2,L} \\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \\ I_{K-1,0} & R_{2K-2,1} & I_{2K-2,1} & R_{2K-2,2} & \cdots & I_{2K-2,L-1} & I_{K-1,L} \\ R_{K,0} & R_{2K-1,1} & I_{2K-1,1} & R_{2K-1,2} & \cdots & I_{2K-1,L-1} & R_{K-1,L} \\ I_{K,0} & R_{2K,1} & I_{2K,1} & R_{2K,2} & \cdots & I_{2K,L-1} & I_{K,L} \\ \end{bmatrix}\in\mathbb{R}^{h \times w}\]

  3. Odd width, \(w = 2L + 1\), and even height, \(h = 2K\)

    \[\begin{bmatrix} R_{0,0} & R_{0,1} & I_{0,1} & R_{0,2} & \cdots & I_{0,L-1} & R_{0,L} & I_{0,L} \\ R_{1,0} & R_{1,1} & I_{1,1} & R_{1,2} & \cdots & I_{1,L-1} & R_{1,L} & I_{1,L} \\ I_{1,0} & R_{2,1} & I_{2,1} & R_{2,2} & \cdots & I_{2,L-1} & R_{2,L} & I_{2,L} \\ R_{2,0} & R_{3,1} & I_{3,1} & R_{3,2} & \cdots & I_{3,L-1} & R_{3,L} & I_{3,L} \\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \\ I_{K-1,0} & R_{2K-2,1} & I_{2K-2,1} & R_{2K-2,2} & \cdots & I_{2K-2,L-1} & R_{2K-2,L} & I_{2K-2,L} \\ R_{K,0} & R_{2K-1,1} & I_{2K-1,1} & R_{2K-1,2} & \cdots & I_{2K-1,L-1} & R_{2K-1,L} & I_{2K-1,L} \\ \end{bmatrix}\in\mathbb{R}^{h \times w}\]

  4. Odd width, \(w = 2L + 1\), and odd height, \(h = 2K + 1\)

    \[\begin{bmatrix} R_{0,0} & R_{0,1} & I_{0,1} & R_{0,2} & \cdots & I_{0,L-1} & R_{0,L} & I_{0,L} \\ R_{1,0} & R_{1,1} & I_{1,1} & R_{1,2} & \cdots & I_{1,L-1} & R_{1,L} & I_{1,L} \\ I_{1,0} & R_{2,1} & I_{2,1} & R_{2,2} & \cdots & I_{2,L-1} & R_{2,L} & I_{2,L} \\ R_{2,0} & R_{3,1} & I_{3,1} & R_{3,2} & \cdots & I_{3,L-1} & R_{3,L} & I_{3,L} \\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \\ I_{K-1,0} & R_{2K-2,1} & I_{2K-2,1} & R_{2K-2,2} & \cdots & I_{2K-2,L-1} & R_{2K-2,L} & I_{2K-2,L} \\ R_{K,0} & R_{2K-1,1} & I_{2K-1,1} & R_{2K-1,2} & \cdots & I_{2K-1,L-1} & R_{2K-1,L} & I_{2K-1,L} \\ I_{K,0} & R_{2K,1} & I_{2K,1} & R_{2K,2} & \cdots & I_{2K,L-1} & R_{2K,L} & I_{2K,L} \\ \end{bmatrix}\in\mathbb{R}^{h \times w}\]

For 1D one-channel data, the format is defined as:

  1. Even length, \(l = \textbf{max}(w, h) = 2L\)

    \[\begin{bmatrix} R_{0} & R_{1} & I_{1} & R_{2} & \cdots & I_{L-1} & R_{L} \end{bmatrix}\in\mathbb{R}^{l}\]

  2. Odd length, \(l = \textbf{max}(w, h) = 2L + 1\)

    \[\begin{bmatrix} R_{0} & R_{1} & I_{1} & R_{2} & \cdots & I_{L-1} & R_{L} & I_{L} \end{bmatrix}\in\mathbb{R}^{l}\]

The input data is expected to be in the CCS-packed format. The output is guaranteed to be in the CCS-packed format.

More resources about the complex conjugate-symmetric format:

Note
For 1D and 2D one-channel input this function produces the same result as OpenCV's cv::multspectums() (requires that TIntermediate=double). For 2D two-channel input refer to the above function elementwiseMultiplication2().
For 1D and 2D one-channel data this function can take the output of OpenCV's cv::dft()
Parameters
sourceAThe pointer of the first source spectrum, must be valid
sourceBThe pointer of the second source spectrum, must be valid
targetThe pointer of the targt spectrum receiving the elementwise multiplication result, must be valid
widthThe width of the input and output spectra, with range [1, infinity)
heightThe height of the input and output spectra, with range [1, infinity)
horizontalPaddingSourceAElementsOptional horizontal padding at the end of each row of the first source specturm (number of complex elements), with range [0, infinity)
horizontalPaddingSourceBElementsOptional horizontal padding at the end of each row of the second source specturm (number of complex elements), with range [0, infinity)
horizontalPaddingTargetElementsOptional horizontal padding at the end of each row of the target specturm (number of complex elements), with range [0, infinity)
Template Parameters
TComplexType of the real and imaginary parts of the complex numbers
tComplexConjugateAIf true, the conjugated values of sourceA will be used in the multiplication, otherwise they will be used as is
tComplexConjugateBIf true, the conjugated values of sourceB will be used in the multiplication, otherwise they will be used as is
TIntermediateType that is used internally for the computation. Size of this can be larger than TComplex which helps reduce float rounding errors.

◆ frequencyToComplexSpatial2()

template<typename T >
static void Ocean::FourierTransformation::frequencyToComplexSpatial2 ( const T *  complexFrequency,
const unsigned int  width,
const unsigned int  height,
T *  complexSpatial,
const unsigned int  frequencyPaddingElements = 0u,
const unsigned int  spatialPaddingElements = 0u 
)
static

Applies a backward Fourier transformation for a given 2D frequency signal.

Parameters
complexFrequencyThe complex 2D frequency signal that will be transformed, must be valid
widthThe width of the 2D signal in elements, with range [1, infinity)
heightheight of the 2D signal in elements, with range [1, infinity)
complexSpatialResulting complex spatial frequency for the given signal, make sure that the provided buffer is large enough, must be valid
frequencyPaddingElementsThe number of padding elements at the end of each row of the frequency analysis, in elements (not complex<T>), with range [0, infinity)
spatialPaddingElementsThe number of padding elements at the end of each row of the spatial signal, in elements with respect to T (not complex<T>), with range [0, infinity)
Template Parameters
TData type of the spatial and frequency signals, either 'float' or 'double'

◆ frequencyToSpatial2()

template<typename T >
static void Ocean::FourierTransformation::frequencyToSpatial2 ( const T *  complexFrequency,
const unsigned int  width,
const unsigned int  height,
T *  spatial,
const unsigned int  frequencyPaddingElements = 0u,
const unsigned int  spatialPaddingElements = 0u 
)
static

Applies a backward Fourier transformation for a given 2D frequency signal.

Parameters
complexFrequencyThe complex 2D frequency signal that will be transformed, must be valid
widthThe width of the 2D signal in elements, with range [1, infinity)
heightheight of the 2D signal in elements, with range [1, infinity)
spatialResulting (real) spatial frequency for the given signal, make sure that the provided buffer is large enough, must be valid
frequencyPaddingElementsThe number of padding elements at the end of each row of the frequency analysis, in elements (not complex<T>), with range [0, infinity)
spatialPaddingElementsThe number of padding elements at the end of each row of the spatial signal, in elements with respect to T (not complex<T>), with range [0, infinity)
Template Parameters
TData type of the spatial and frequency signals, either 'float' or 'double'

◆ getOptimalDFTSize0()

static int Ocean::FourierTransformation::getOptimalDFTSize0 ( int  size)
static

Returns the optimal DFT size for a given vector size.

See also
cv::getOptimalDFTSize()
Parameters
sizeThe size of the vector
Returns
Optimal size for the DFT

◆ imaginaryToScalar()

template<typename TComplex , typename TScalar >
void Ocean::FourierTransformation::imaginaryToScalar ( const std::complex< TComplex > *  source,
TScalar *  target,
const size_t  number 
)
inlinestatic

Converts the imaginary components of complex values to scalar values.

Parameters
sourceComplex source values
targetResulting scalar values, make sure that the provided memory is large enough
numberNumber of elements that will be converted
Template Parameters
TComplexData type of the complex signal
TScalarData type of the real signal

◆ realToScalar()

template<typename TComplex , typename TScalar >
void Ocean::FourierTransformation::realToScalar ( const std::complex< TComplex > *  source,
TScalar *  target,
const size_t  number 
)
inlinestatic

Converts the real components of complex values to scalar values.

Parameters
sourceComplex source values
targetResulting scalar values, make sure that the provided memory is large enough
numberNumber of elements that will be converted
Template Parameters
TComplexData type of the complex signal
TScalarData type of the real signal

◆ scalarToComplex()

template<typename TScalar , typename TComplex >
void Ocean::FourierTransformation::scalarToComplex ( const TScalar *  source,
std::complex< TComplex > *  target,
const size_t  number 
)
inlinestatic

Converts scalar values to complex values.

Parameters
sourceScalar source values
targetResulting complex values, make sure that the provided memory is large enough
numberNumber of elements that will be converted
Template Parameters
TScalarData type of the real signal
TComplexData type of the complex signal

◆ shiftCenter()

unsigned int Ocean::FourierTransformation::shiftCenter ( const unsigned int  size)
inlinestatic

Returns the center position for shift operations that corresponds with the first Fourier element.

Parameters
sizeSize of the signal in bins, with range (0, infinity)
Returns
Corresponding center position of the first bin

◆ shiftHalfDimension2() [1/2]

template<typename T >
void Ocean::FourierTransformation::shiftHalfDimension2 ( const T *  source,
unsigned int  width,
const unsigned int  height,
T *  target 
)
static

Shifts a given signal by half of the width and the height.

Parameters
sourceThe source signal that will be shifted
widthThe width of the signal in elements, must be even
heightThe height of the signal in elements, must be even
targetThe target signal that will receive the shifted signal
Template Parameters
TData type of the signal

◆ shiftHalfDimension2() [2/2]

template<typename T >
void Ocean::FourierTransformation::shiftHalfDimension2 ( T *  data,
unsigned int  width,
const unsigned int  height 
)
static

Shifts a given signal by half of the width and the height.

Parameters
dataSignal that will be shifted
widthThe width of the signal in elements, must be even
heightThe height of the signal in elements, must be even
Template Parameters
TData type of the signal

◆ spatialToFrequency2()

template<typename T >
static void Ocean::FourierTransformation::spatialToFrequency2 ( const T *  spatial,
const unsigned int  width,
const unsigned int  height,
T *  complexFrequency,
const unsigned int  spatialPaddingElements = 0u,
const unsigned int  frequencyPaddingElements = 0u 
)
static

Applies a forward Fourier transformation for a given 2D (real) spatial signal.

Parameters
spatialThe real 2D spatial signal that will be transformed, must be valid
widthThe width of the 2D signal in elements, with range [1, infinity)
heightheight of the 2D signal in elements, with range [1, infinity)
complexFrequencyResulting complex frequency analysis for the given signal, must be valid
spatialPaddingElementsThe number of padding elements at the end of each row of the spatial signal, in elements with respect to T (not complex<T>), with range [0, infinity)
frequencyPaddingElementsThe number of padding elements at the end of each row of the frequency analysis, in elements (not complex<T>), with range [0, infinity)
Template Parameters
TThe element data type of the spatial and frequency signals, either 'float' or 'double'

The documentation for this class was generated from the following file: