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