Das2Dft Struct Reference

#include <das2/dft.h>


Detailed Description

An amplitude preserving Discrete Fourier Transform converter.

This is small wrapper around fftw to handle memory management, normalization, and windowing

Public Member Functions

Das2Dftnew_Dft (size_t uLen, const char *sWindow)
 Create a new DFT calculator.
void del_Dft (Das2Dft *pThis)
 Free a DFT (Discrete Fourier Transform) calculator.
ErrorCode Dft_calculate (Das2Dft *pThis, const double *pReal, const double *pImg, size_t uLen)
 Calculate a discrete Fourier transform.
const double * Dft_getImg (Das2Dft *pThis, size_t *pLen)
 Return the imaginary component after a calculation.
const double * Dft_getMagnitude (Das2Dft *pThis, size_t *pLen)
 Get the amplitude magnitude vector from a calculation.

Member Function Documentation

Das2Dft * new_Dft ( size_t  uLen,
const char *  sWindow 
)

Create a new DFT calculator.

Parameters:
nLen - The length of the data vectors that will be supplied to the calculate function
sWindow - A named window to apply to the data. If NULL then no window will be used.
Returns:
A new Das2Dft object allocated on the heap.
void del_Dft ( Das2Dft pThis  ) 

Free a DFT (Discrete Fourier Transform) calculator.

Parameters:
pThis the DFT calculator to free, the caller should set the object pointer to NULL after this call.
ErrorCode Dft_calculate ( Das2Dft pThis,
const double *  pReal,
const double *  pImg,
size_t  uLen 
)

Calculate a discrete Fourier transform.

Using the calculation plan setup in the constructor, calculate a discrete Fourier transform. When this function is called internal storage of any previous DFT calculations (if any) are over written.

Parameters:
pThis The DFT object
pReal A "time domain" input vector of length uLen
pImg The imaginary (or quadrature phase) input vector of length uLen. For a purely real signal this vector is NULL.
uLen The number of reals in the input signal. If this value changes between successive calls to this function for the same Dft object then you're code will take a performance hit.
Returns:
0 (DAS_OKAY) if the calculation was successful, a non-zero error code otherwise
const double * Dft_getImg ( Das2Dft pThis,
size_t *  pLen 
)

Return the imaginary component after a calculation.

Parameters:
pThis 
pLen 
Returns:
const double * Dft_getMagnitude ( Das2Dft pThis,
size_t *  pLen 
)

Get the amplitude magnitude vector from a calculation.

Scale the stored DFT so that it preserves amplitude, and get the magnitude. For real-valued inputs (complex pointer = 0) the 'positive' and 'negative' frequencies are combined. For complex input vectors this is not the case since all DFT output amplitudes are unique. Stated another way, for complex input signals components above the Nyquist frequency have meaningful information.

Parameters:
pThis The DFT calculator object which has previously been called to calculate a result.
pLen The vector length. In general this is *NOT* the same as the input time series length. For real-value input signals (complex input is NULL, this is N/2 + 1. For complex input signals this is N.
Returns:
A pointer to an internal holding bin for the real signal magnitude values.
Warning:
: If Dft_calculate() is called again, this pointer can be invalidated. If a permanent result is needed after subsequent Dft_calculate() calls, copy these data to another buffer.

The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 11 Sep 2016 for Das2 Stream Utilities by  doxygen 1.6.1