Output
Armadillo FFT Time = 46.8176
FFTW Loop[1]. Time = 0.052592
FFTW Loop[2]. Time = 0.003976
FFTW Loop[3]. Time = 0.003865
FFTW Loop[4]. Time = 0.003716
Source
using namespace arma;
{
int N = 45191;
vec x( N );
cx_vec Sxx( N );
vec P( N );
clock_t tic;
x.randn();
tic = clock();
Sxx = fft( x );
cout << "Armadillo FFT Time = " << ( clock() - tic ) / double( CLOCKS_PER_SEC ) << endl;
tic = clock();
Sxx = fft( x );
cout << "Armadillo FFT Time = " << ( clock() - tic ) / double( CLOCKS_PER_SEC ) << endl;
for( int n = 1; n < 5; n++ )
{
x.randn();
tic = clock();
cout << "FFTW Loop[" << n << "]. Time = " << ( clock() - tic ) / double( CLOCKS_PER_SEC ) << endl;
}
return 0;
}
void fft(arma::vec &x, arma::cx_vec &Pxx)
FFT of real input.