isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
isce3::signal::NFFT< class > Class Template Reference

Non-equispaced fast Fourier transform (NFFT) More...

#include <NFFT.h>

Public Member Functions

 NFFT (size_t m, size_t n, size_t fft_size)
 NFFT Constructor. More...
 
void execute (const std::valarray< std::complex< T >> &spectrum, const std::valarray< double > &times, std::valarray< std::complex< T >> &out)
 Execute a transform. More...
 
void execute (size_t isize, size_t istride, const std::complex< T > *spectrum, size_t tsize, size_t tstride, const double *times, size_t osize, size_t ostride, std::complex< T > *out)
 Execute a transform (raw pointer interface). More...
 
void execute_adjoint (const std::valarray< std::complex< T >> &time_series, const std::valarray< double > &times, std::valarray< std::complex< T >> &spectrum)
 Execute an adjoint transform. More...
 
void execute_adjoint (size_t isize, size_t istride, const std::complex< T > *time_series, size_t tsize, size_t tstride, const double *times, size_t osize, size_t ostride, std::complex< T > *spectrum)
 Execute an adjoint transform (raw pointer interface). More...
 
void set_spectrum (const std::valarray< std::complex< T >> &x)
 Ingest a spectrum for transform. More...
 
void set_spectrum (size_t size, size_t stride, const std::complex< T > *x)
 Ingest a spectrum for transform (raw pointer interface). More...
 
std::complex< T > interp (double t) const
 Interpolate the transformed signal. More...
 
size_t size_kernel () const
 
size_t size_spectrum () const
 
size_t size_transform () const
 

Detailed Description

template<class>
class isce3::signal::NFFT< class >

Non-equispaced fast Fourier transform (NFFT)

Class implementing NFFT algorithm described in [4] . It takes a uniformly sampled spectrum and produces time-domain samples at arbitrary locations.

Compared to the TU Chemnitz implementation there are some differences in conventions intended to make things simpler in the SAR context:

  1. Sign conventions. NFFT.execute() uses a positive phase (backward), while NFFT.execute_adjoint() uses a negative phase (forward). This consistent with uses where the frequency spectrum is uniformly sampled and the time domain is not.
  2. Order of spectra. Spectra are expected to be in FFTW order, e.g. low frequencies at the ends and high frequencies in the middle.
  3. Scaling of time/frequency. Locations are specified as sample numbers (at rate consistent with spectrum size) instead of the unit torus.
  4. Sample locations do not need to be specified in advance. You can use NFFT.set_spectrum and then NFFT.interp all the points you want on the fly. The NFFT.execute convenience function combines these.

Constructor & Destructor Documentation

template<class T >
isce3::signal::NFFT< T >::NFFT ( size_t  m,
size_t  n,
size_t  fft_size 
)

NFFT Constructor.

Parameters
[in]mInterpolation kernel size parameter (width=2*m+1).
[in]nLength of spectrum.
[in]fft_sizeTransform size (> n).

Member Function Documentation

template<class T >
void isce3::signal::NFFT< T >::execute ( const std::valarray< std::complex< T >> &  spectrum,
const std::valarray< double > &  times,
std::valarray< std::complex< T >> &  out 
)

Execute a transform.

Equivalent to

\[ f_j = \frac{1}{N} \sum_{k=-\frac{N}{2}}^{\frac{N}{2}-1} \hat{f}_k \exp(+2\pi i k t_j / N) \]

Where \( N \) is the size of the spectrum.

Parameters
[in]spectrumSignal to transform, in FFTW order.
[in]timesDesired sample locations in [0:n)
[out]outStorage for output signal, same length as times.

Equivalent to set_spectrum and out[i]=NFFT::interp(times[i]).

See Also
set_spectrum
interp
template<class T >
void isce3::signal::NFFT< T >::execute ( size_t  isize,
size_t  istride,
const std::complex< T > *  spectrum,
size_t  tsize,
size_t  tstride,
const double *  times,
size_t  osize,
size_t  ostride,
std::complex< T > *  out 
)

Execute a transform (raw pointer interface).

Parameters
[in]isizeLength of spectrum (should be == n)
[in]istrideStride between elements of spectrum.
[in]spectrumSignal to transform, in FFTW order.
[in]tsizeNumber of output time samples.
[in]tstrideStride between elements of time array.
[in]timesDesired sample locations in [0:n)
[in]tsizeNumber of output samples (should be == tsize).
[in]tstrideStride between elements of output array.
[out]outStorage for output signal.

Equivalent to set_spectrum and out[i]=NFFT::interp(times[i]).

See Also
set_spectrum
interp
template<class T >
void isce3::signal::NFFT< T >::execute_adjoint ( const std::valarray< std::complex< T >> &  time_series,
const std::valarray< double > &  times,
std::valarray< std::complex< T >> &  spectrum 
)

Execute an adjoint transform.

Equivalent to

\[ \hat{f}_k = \sum_{j=0}^{M-1} f_j \exp(-2\pi i k t_j / N) \]

Where \( M \) is the number of time samples and \( N \) is the size of the spectrum.

Parameters
[in]time_seriesSignal to transform.
[in]timesSample locations in [0:n) of input signal.
[out]spectrumStorage for output spectrum. Length should be equal to size_spectrum().
template<class T >
void isce3::signal::NFFT< T >::execute_adjoint ( size_t  isize,
size_t  istride,
const std::complex< T > *  time_series,
size_t  tsize,
size_t  tstride,
const double *  times,
size_t  osize,
size_t  ostride,
std::complex< T > *  spectrum 
)

Execute an adjoint transform (raw pointer interface).

Parameters
[in]isizeLength of input signal.
[in]istrideStride between elements of input signal.
[in]time_seriesSignal to transform.
[in]tsizeLength of time vector. Should == isize.
[in]tstrideStride of time vector.
[in]timesSample locations in [0:n) of input signal.
[in]osizeLength of output signal (== size_spectrum())
[in]ostrideStride between elements of output signal.
[out]spectrumStorage for output spectrum.
template<class T >
std::complex< T > isce3::signal::NFFT< T >::interp ( double  t) const

Interpolate the transformed signal.

Parameters
[in]tLocation in [0,n) to sample the time-domain signal.
See Also
execute is an alternative strategy.
set_spectrum must be called first.
template<class T >
void isce3::signal::NFFT< T >::set_spectrum ( const std::valarray< std::complex< T >> &  x)

Ingest a spectrum for transform.

Parameters
[in]xSpectrum to transform. Should be in FFTW order, e.g., [0:pi, -pi:0).

This function will filter, zero-pad, and transform the input data. After this you can call NFFT.interp.

See Also
execute Is an alternative strategy.
interp
template<class T >
void isce3::signal::NFFT< T >::set_spectrum ( size_t  size,
size_t  stride,
const std::complex< T > *  x 
)

Ingest a spectrum for transform (raw pointer interface).

Parameters
[in]sizeLength of signal. Should be same as n in constructor or else zero-padding will be wrong.
[in]strideStride between array elements.
[in]xSpectrum to transform. Should be in FFTW order, e.g., [0:pi, -pi:0).

This function will filter, zero-pad, and transform the input data. After this you can call the interp method.


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

Generated for ISCE3.0 by doxygen 1.8.5.