Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UIT2_SpectrumAnalyzer F746_SpectralAnalysis_NoPhoto F746_FFT_Speed F746_RealtimeSpectrumAnalyzer ... more
fftReal.hpp
00001 //------------------------------------------------------------------- 00002 // データが実数の場合の FFT class(ヘッダ) 00003 // 00004 // 2020/12/12, Copyright (c) 2020 MIKAMI, Naoki 00005 //------------------------------------------------------------------- 00006 00007 #ifndef FFT_REAL_HPP 00008 #define FFT_REAL_HPP 00009 00010 #include "Array.hpp" // "Array_Matrix" という名前で Mbed に登録 00011 #include <complex> // complex で使用 00012 00013 namespace Mikami 00014 { 00015 typedef complex<float> Complex; // "Complex" の定義 00016 00017 class FftReal 00018 { 00019 public: 00020 // コンストラクタ 00021 explicit FftReal(int16_t n); 00022 // FFT の実行 00023 void Execute(const float x[], Complex y[]); 00024 // IFFT の実行 00025 void ExecuteIfft(const Complex y[], float x[]); 00026 00027 private: 00028 const int N_FFT_; 00029 const float N_INV_; 00030 Array<Complex> wTable_; // 回転子 00031 Array<uint16_t> bTable_; // ビット逆順 00032 Array<Complex> u_; // 作業領域 00033 00034 // 最終ステージを除いた処理 00035 void ExcludeLastStage(); 00036 // IFFT のビット逆順の並べ替えで使用 00037 int Index(int n) const { return (N_FFT_-bTable_[n]); } 00038 00039 // コピー・コンストラクタおよび代入演算子の禁止のため 00040 FftReal(const FftReal& ); 00041 FftReal& operator=(const FftReal& ); 00042 }; 00043 } 00044 #endif // FFT_REAL_HPP
Generated on Wed Jul 13 2022 23:06:38 by
1.7.2