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 > ×, 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 > ×, 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 |
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:
isce3::signal::NFFT< T >::NFFT | ( | size_t | m, |
size_t | n, | ||
size_t | fft_size | ||
) |
NFFT Constructor.
[in] | m | Interpolation kernel size parameter (width=2*m+1). |
[in] | n | Length of spectrum. |
[in] | fft_size | Transform size (> n). |
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.
[in] | spectrum | Signal to transform, in FFTW order. |
[in] | times | Desired sample locations in [0:n) |
[out] | out | Storage for output signal, same length as times. |
Equivalent to set_spectrum and out[i]=NFFT::interp(times[i]).
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).
[in] | isize | Length of spectrum (should be == n) |
[in] | istride | Stride between elements of spectrum. |
[in] | spectrum | Signal to transform, in FFTW order. |
[in] | tsize | Number of output time samples. |
[in] | tstride | Stride between elements of time array. |
[in] | times | Desired sample locations in [0:n) |
[in] | tsize | Number of output samples (should be == tsize). |
[in] | tstride | Stride between elements of output array. |
[out] | out | Storage for output signal. |
Equivalent to set_spectrum and out[i]=NFFT::interp(times[i]).
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.
[in] | time_series | Signal to transform. |
[in] | times | Sample locations in [0:n) of input signal. |
[out] | spectrum | Storage for output spectrum. Length should be equal to size_spectrum(). |
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).
[in] | isize | Length of input signal. |
[in] | istride | Stride between elements of input signal. |
[in] | time_series | Signal to transform. |
[in] | tsize | Length of time vector. Should == isize. |
[in] | tstride | Stride of time vector. |
[in] | times | Sample locations in [0:n) of input signal. |
[in] | osize | Length of output signal (== size_spectrum()) |
[in] | ostride | Stride between elements of output signal. |
[out] | spectrum | Storage for output spectrum. |
std::complex< T > isce3::signal::NFFT< T >::interp | ( | double | t | ) | const |
Interpolate the transformed signal.
[in] | t | Location in [0,n) to sample the time-domain signal. |
void isce3::signal::NFFT< T >::set_spectrum | ( | const std::valarray< std::complex< T >> & | x | ) |
Ingest a spectrum for transform.
[in] | x | Spectrum 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.
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).
[in] | size | Length of signal. Should be same as n in constructor or else zero-padding will be wrong. |
[in] | stride | Stride between array elements. |
[in] | x | Spectrum 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.