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.
Dependencies: F746_GUI F746_SAI_IO UIT_FFT_Real
FFT_Analysis.cpp
00001 //------------------------------------------------------- 00002 // Class for spectrum analysis using FFT 00003 // 00004 // 2017/03/30, Copyright (c) 2017 MIKAMI, Naoki 00005 //------------------------------------------------------- 00006 00007 #include "FFT_Analysis.hpp" 00008 00009 namespace Mikami 00010 { 00011 FftAnalyzer::FftAnalyzer(int nData, int nFft) 00012 : AnalyzerBase(nData, nFft, nFft), 00013 yFft_(nFft/2+1) {} 00014 00015 void FftAnalyzer::Analyze(const float xn[], float yn[]) 00016 { 00017 fft_.Execute(xn, yFft_); // Execute FFT 00018 00019 // Translate to dB 00020 for (int n=0; n<=N_FFT_/2; n++) 00021 yn[n] = 10.0f*log10f(Norm(yFft_[n])); 00022 } 00023 }
Generated on Tue Jul 12 2022 18:30:30 by
