35 #define CXXFFTWTEST_VERSION \ 36 "CXXFFTWTEST V1.1 a small test program for fftw when called from C++" 39 #include <tfxx/commandline.h> 61 a(a.f()+k)=sin(k*f1)*sin(k*f1)*sin(k*f2);
63 cout <<
"array filled" << endl;
68 void process(
int n,
int m,
const bool& verbose,
const bool& debug)
70 cout <<
"test with " << n <<
" samples" << endl;
71 cout <<
"test with frequency " << m << endl;
74 if (verbose) { cout <<
"array is filled " << endl; }
76 if (verbose) { cout <<
"processor is created " << endl; }
78 if (verbose) { cout <<
"forward transform is finished" << endl; }
79 Tseries c=fftprocessor(b, debug);
80 if (verbose) { cout <<
"backward transform is finished" << endl; }
81 cout <<
"time series:" << endl;
82 for (
int i=0; i<n ; ++i)
93 cout <<
"power spectrum:" << endl;
94 for (
int i=0; i<b.size() ; ++i)
97 cout << i <<
" " << abs(b(i)*conj(b(i))) << endl;
109 int main(
int iargc,
char* argv[])
116 "usage: cxxfftwtest [-n n] [-m f]" "\n" 117 " or: cxxfftwtest --help|-h" "\n" 124 "-n n set number of samples to n\n" 125 "-m f set frequency to f\n" 129 using namespace tfxx::cmdline;
130 static Declare options[]=
137 {
"DEBUG",arg_no,
"-"},
148 cerr << usage_text << endl;
153 Commandline cmdline(iargc, argv, options);
156 if (cmdline.optset(0))
158 cerr << usage_text << endl;
159 cerr << help_text << endl;
165 opt.
debug=cmdline.optset(2);
166 opt.
n=cmdline.int_arg(3);
167 opt.
m=cmdline.int_arg(4);
aff::Series< Tsample > Tseries
#define FOURIER_assert(C, M)
Check an assertion and report by throwing an exception.
DRFFTWAFF::Tspectrum Tspectrum
aff::Series< Tcoeff > Tspectrum
error handling for libfourier (prototypes)
#define CXXFFTWTEST_VERSION
void process(int n, int m, const bool &verbose, const bool &debug)
int main(int iargc, char *argv[])
aff::Series< Tvalue > Tseries
use fftw together with aff containers (prototypes)
void fill(Tseries &a, int n, int m)
DRFFTWAFF::Tseries Tseries