42 #define TF_FFTWAFF_CC_VERSION \ 49 #include <aff/seriesoperators.h> 75 "Error (DRFFTWAFF::create_plan_forward): " 76 "could not create plan!")
96 "Error (DRFFTWAFF::create_plan_backward): " 97 "could not create plan!")
152 "Error (DRFFTWAFF::create_plan_forward): " 153 "could not create series array!")
156 fftw_malloc(sizeof(fftw_complex)*this->
ssize());
159 "could not create spectrum array!")
187 const bool& debug)
const 192 "use fallback code (FFTW2)");
194 aff::Series<fftw_real> out(this->
Msize);
195 aff::Series<fftw_real> in(this->
Msize);
196 fftw_real* pout=out.pointer();
197 fftw_real* pin=in.pointer();
199 "processing arrays are created; copy in series");
203 "create plan forward");
209 "copy results to output");
211 for (
int i=1; i<((
Msize+1)/2); ++i)
215 if ((
Msize % 2) == 0)
228 "use recent code (FFTW3)");
262 const bool& debug)
const 265 if (this->
ssize() != s.size())
272 if (std::abs(s(s.size()).imag()) < 1.e-8*std::abs(s(s.size()).real()))
279 aff::Series<fftw_real> out(
Msize);
280 aff::Series<fftw_real> in(
Msize);
281 fftw_real* pout=out.pointer();
282 fftw_real* pin=in.pointer();
284 for (
int i=1; i<((
Msize+1)/2); ++i)
287 in(
Msize-i)=s(i).imag();
289 if ((
Msize % 2) == 0)
319 return(1./(
Msize*dt));
346 const bool& debug)
const 361 const bool& debug)
const 364 this->
operator()(s, debug));
Tsample scale_series(const Tsample &dt) const
Return appropriate scaling factor for sampling interval dt.
aff::Series< Tsample > Tseries
#define FOURIER_assert(C, M)
Check an assertion and report by throwing an exception.
DRFFTWAFF::Tspectrum Tspectrum
fftw_complex * Mspectrumarray
Tspectrum operator()(const Tseries::Tcoc &s, const bool &debug=false) const
Transform time series to Fourier coefficients.
void create_plan_backward() const
create plan.
unsigned int size() const
aff::Series< Tcoeff > Tspectrum
std::complex< Tsample > Tcoeff
error handling for libfourier (prototypes)
void delete_plans() const
delete plans.
static unsigned int seriessize(const unsigned int &n)
return number of samples for given number of coefficients
void create_plan_forward() const
create plan.
#define FOURIER_debug(C, N, M)
produce debug output
void set_size(const unsigned int &n) const
prepare FFT settings for size n.
aff::Series< Tvalue > Tseries
use fftw together with aff containers (prototypes)
Tsample scale_spectrum(const Tsample &dt) const
Return appropriate scaling factor for sampling interval dt.
unsigned int ssize() const
void create_arrays() const
create plans.
void delete_arrays() const
delete arrays.