![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Application example of FftReal class. FftReal クラスの使用例.
Dependencies: Array_Matrix mbed UIT_FFT_Real
Diff: dftComplex.hpp
- Revision:
- 4:8248d5b5cdc9
- Parent:
- 3:4ef52c7f5281
--- a/dftComplex.hpp Mon Jan 13 08:57:54 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -//-------------------------------------------------------------- -// DIscrete Fourier transform (DFT) -// Copyright (c) 2014 MIKAMI, Naoki, 2014/06/28 -//-------------------------------------------------------------- - -#include "mbed.h" -#include <complex> // requisite for complex - -typedef complex<float> Complex; // define "Complex" - -void DftComplex(const float x[], Complex y[], int nFft); - -// Calculate DFT -void DftComplex(const float x[], Complex y[], int nFft) -{ - Complex j2PiN = Complex(0, -6.28318531f/nFft); - - for (int k=0; k<nFft; k++) - { - y[k] = 0.0; - for (int n=0; n<nFft; n++) - y[k] = y[k] + x[n]*exp(j2PiN*(float)(n*k)); - } -} \ No newline at end of file