![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Application example of FftReal class. FftReal クラスの使用例.
Dependencies: Array_Matrix mbed UIT_FFT_Real
Diff: main.cpp
- Revision:
- 3:4ef52c7f5281
- Parent:
- 2:03e1399ed9eb
- Child:
- 4:8248d5b5cdc9
diff -r 03e1399ed9eb -r 4ef52c7f5281 main.cpp --- a/main.cpp Thu Oct 29 06:33:32 2015 +0000 +++ b/main.cpp Mon Jan 13 08:57:54 2020 +0000 @@ -1,13 +1,12 @@ //-------------------------------------------------------------- // Demo program of FftReal class -// Copyright (c) 2015 MIKAMI, Naoki, 2015/10/29 +// +// Copyright (c) 2020 MIKAMI, Naoki, 2020/01/13 //-------------------------------------------------------------- #include "dftComplex.hpp" #include "fftReal.hpp" -#include "mbed.h" - using namespace Mikami; int main() @@ -26,15 +25,19 @@ for (int n=0; n<N; n++) printf("f[%2d]: %8.4f\r\n", n, x1[n]); + Timer tm; // for measurement of execution time + // DFT, for comarison + tm.reset(); + tm.start(); DftComplex(x1, y1, N); + tm.stop(); + printf("\r\nExecution time (DFT): %d [us]\r\n", tm.read_us()); printf("\r\n#### Result of direct DFT ####\r\n"); printf(" real imaginary\r\n"); for (int n=0; n<N; n++) printf("F[%2d]: %8.4f, %8.4f\r\n", n, y1[n].real(), y1[n].imag()); - Timer tm; // for measurement of execution time - // FFT FftReal fft(N); tm.reset(); @@ -56,4 +59,4 @@ printf(" original IFFT of FFT\r\n"); for (int n=0; n<N; n++) printf("f[%2d]: %8.4f, %8.4f\r\n", n, x1[n], x2[n]); -} +} \ No newline at end of file