SigPack - the C++ signal processing library
 
Loading...
Searching...
No Matches
fftw_loop.cpp
Go to the documentation of this file.
1
15#include "sigpack.h"
16using namespace arma;
17
18int main()
19{
20 int N = 45191; // Large prime number
21 sp::FFTW ss( N, FFTW_ESTIMATE );
22 vec x( N );
23 cx_vec Sxx( N );
24
25 vec P( N );
26 clock_t tic;
27 x.randn();
28 tic = clock();
29 Sxx = fft( x );
30 cout << "Armadillo FFT Time = " << ( clock() - tic ) / double( CLOCKS_PER_SEC ) << endl;
31
32 tic = clock();
33 Sxx = fft( x );
34 cout << "Armadillo FFT Time = " << ( clock() - tic ) / double( CLOCKS_PER_SEC ) << endl;
35
36 for( int n = 1; n < 5; n++ )
37 {
38 x.randn();
39 tic = clock();
40 Sxx = ss.fft( x );
41 cout << "FFTW Loop[" << n << "]. Time = " << ( clock() - tic ) / double( CLOCKS_PER_SEC ) << endl;
42 }
43 return 0;
44}
FFTW class.
Definition fftw.h:26
void fft(arma::vec &x, arma::cx_vec &Pxx)
FFT of real input.
Definition fftw.h:162
int main()
Definition fftw_loop.cpp:18