Fourier library: Operations in the Fourier domain
|
Engine to transform several signals at once. References to workspace are passed to the contstructor. More...
#include <fftwaffar.h>
Public Types | |
typedef double | Tsample |
typedef std::complex< Tsample > | Tcoeff |
typedef aff::Array< Tsample > | TAseries |
typedef aff::Array< Tcoeff > | TAspectrum |
Public Member Functions | |
DRFFTWAFFArrayEngine (const int &nseis, const int &nsamp) | |
DRFFTWAFFArrayEngine (const TAseries &series, const TAspectrum &spec) | |
DRFFTWAFFArrayEngine (const DRFFTWAFFArrayEngine &engine) | |
DRFFTWAFFArrayEngine () | |
DRFFTWAFFArrayEngine & | operator= (const DRFFTWAFFArrayEngine &e) |
~DRFFTWAFFArrayEngine () | |
delete plan. More... | |
void | r2c () |
execute r2c plan More... | |
void | c2r () |
execute c2r plan More... | |
Tsample | scale_series (const Tsample &dt) const |
Return appropriate scaling factor for sampling interval dt. More... | |
Tsample | scale_spectrum (const Tsample &dt) const |
Return appropriate scaling factor for sampling interval dt. More... | |
TAseries | series () const |
return a reference to the time series arrays More... | |
TAspectrum | spectrum () const |
return a reference to the Fourier coefficient arrays More... | |
unsigned int | nseries () const |
return the number of series in the arrays More... | |
unsigned int | nsamples () const |
return the number of samples in time series More... | |
unsigned int | nfrequencies () const |
return the number of positive frequencies used More... | |
TAseries | series (const unsigned int &i) const |
return a reference to the time series i More... | |
TAspectrum | spectrum (const unsigned int &i) const |
return a reference to the Fourier coefficients of series i More... | |
Static Public Member Functions | |
static unsigned int | ncoeff (const unsigned int &nsamples) |
return number of coefficients for given number of samples More... | |
static unsigned int | nsamples (const unsigned int &n) |
return number of samples for given number of coefficients More... | |
Private Member Functions | |
void | checkconsistency () |
void | createplanr2c () |
void | createplanc2r () |
void | delete_plans () |
delete plans. More... | |
Private Attributes | |
TAseries | Mseriesarray |
TAspectrum | Mspectrumarray |
fftw_plan | Mplanr2c |
fftw_plan | Mplanc2r |
Engine to transform several signals at once. References to workspace are passed to the contstructor.
The difference between DRFFTWAFF and DRFFTWAFFArrayEngine is that the latter transforms more than on signal at the same time. It uses a persistent workspace and makes full use of the reference semantics implemented in aff::Array.
The class is designed for strided arrays. aff::Array has to be used together with aff::Strided. Currently (5/2011) there is no alternative in the aff::Array class template.
When initializing DRFFTWAFFArrayEngine either the dimensions of the time series array must be passed or a readily prepared workspace is passed to the engine. In both cases the engine assumes that the user program holds references to the seismogram and the coefficient array through instances of aff::Array. The engine is just called to do the actual transform. New values to be transformed are received through the common reference with the user program. A reference to the arrays is provided through member functions.
The first index to the array is the sample index, the second index is the signal index. This is due to the column major arrangement used by aff::Array containers by default (this is the common Fortran layout).
Definition at line 87 of file fftwaffar.h.