Go to the source code of this file.
|
void | demo_all_types (int nfft) |
|
template<typename T_time , typename T_freq > |
void | fwd_inv (size_t nfft) |
|
template<typename T > |
T | mag2 (const std::vector< std::complex< T > > &vec) |
|
template<typename T > |
T | mag2 (const std::vector< T > &vec) |
|
template<typename T > |
T | mag2 (std::complex< T > a) |
|
template<typename T > |
T | mag2 (T a) |
|
int | main () |
|
template<typename T > |
vector< T > | operator- (const vector< T > &a, const vector< T > &b) |
|
template<typename T > |
void | RandomFill (std::vector< std::complex< T > > &vec) |
|
template<typename T > |
void | RandomFill (std::vector< T > &vec) |
|
template<typename T_scalar > |
void | two_demos (int nfft) |
|
◆ demo_all_types()
void demo_all_types |
( |
int |
nfft | ) |
|
Definition at line 101 of file FFT.cpp.
103 cout <<
"nfft=" << nfft << endl;
104 cout <<
" float" << endl;
105 two_demos<float>(nfft);
106 cout <<
" double" << endl;
107 two_demos<double>(nfft);
108 cout <<
" long double" << endl;
109 two_demos<long double>(nfft);
◆ fwd_inv()
template<typename T_time , typename T_freq >
void fwd_inv |
( |
size_t |
nfft | ) |
|
Definition at line 75 of file FFT.cpp.
78 vector<T_time> timebuf(nfft);
81 vector<T_freq> freqbuf;
83 fft.
fwd(freqbuf,timebuf);
85 vector<T_time> timebuf2;
86 fft.
inv(timebuf2,freqbuf);
88 T_time rmse =
mag2(timebuf - timebuf2) /
mag2(timebuf);
89 cout <<
"roundtrip rmse: " << rmse << endl;
void RandomFill(std::vector< T > &vec)
void fwd(Complex *dst, const Scalar *src, Index nfft)
fft_inv_proxy< MatrixBase< InputDerived >, FFT< T_Scalar, T_Impl > > inv(const MatrixBase< InputDerived > &src, Index nfft=-1)
◆ mag2() [1/4]
template<typename T >
T mag2 |
( |
const std::vector< std::complex< T > > & |
vec | ) |
|
Definition at line 43 of file FFT.cpp.
46 for (
size_t k=0;k<vec.size();++k)
◆ mag2() [2/4]
template<typename T >
T mag2 |
( |
const std::vector< T > & |
vec | ) |
|
Definition at line 34 of file FFT.cpp.
37 for (
size_t k=0;k<vec.size();++k)
◆ mag2() [3/4]
template<typename T >
T mag2 |
( |
std::complex< T > |
a | ) |
|
◆ mag2() [4/4]
◆ main()
Definition at line 112 of file FFT.cpp.
void demo_all_types(int nfft)
◆ operator-()
template<typename T >
vector<T> operator- |
( |
const vector< T > & |
a, |
|
|
const vector< T > & |
b |
|
) |
| |
Definition at line 52 of file FFT.cpp.
55 for (
size_t k=0;k<
b.size();++k)
◆ RandomFill() [1/2]
template<typename T >
void RandomFill |
( |
std::vector< std::complex< T > > & |
vec | ) |
|
Definition at line 68 of file FFT.cpp.
70 for (
size_t k=0;k<vec.size();++k)
71 vec[k] = std::complex<T> (
T( rand() )/
T(RAND_MAX) -
T(.5),
T( rand() )/
T(RAND_MAX) -
T(.5));
◆ RandomFill() [2/2]
template<typename T >
void RandomFill |
( |
std::vector< T > & |
vec | ) |
|
Definition at line 61 of file FFT.cpp.
63 for (
size_t k=0;k<vec.size();++k)
64 vec[k] =
T( rand() )/
T(RAND_MAX) -
T(.5);
◆ two_demos()
template<typename T_scalar >
void two_demos |
( |
int |
nfft | ) |
|
Definition at line 93 of file FFT.cpp.
96 fwd_inv<T_scalar,std::complex<T_scalar> >(nfft);
98 fwd_inv<std::complex<T_scalar>,std::complex<T_scalar> >(nfft);