-
大小: 5KB文件類(lèi)型: .cpp金幣: 1下載: 0 次發(fā)布日期: 2021-01-03
- 語(yǔ)言: C/C++
- 標(biāo)簽: FFT??c++??c++實(shí)現(xiàn)fft??
資源簡(jiǎn)介
快速傅里葉變換FFT算法完整實(shí)現(xiàn)C++代碼
附帶詳細(xì)注釋和數(shù)十組測(cè)試數(shù)據(jù)
代碼片段和文件信息
/************************************************
*?FFT?code?from?the?book?Numerical?Recipes?in?C?*
*?Visit?www.nr.com?for?the?licence.?????????????*
************************************************/
//?The?following?line?must?be?defined?before?including?math.h?to?correctly?define?M_PI
#define?_USE_MATH_DEFINES
#include?
#include?
#include?
#define?PI M_PI /*?pi?to?machine?precision?defined?in?math.h?*/
#define?TWOPI (2.0*PI)
/*
?FFT/IFFT?routine.?(see?pages?507-508?of?Numerical?Recipes?in?C)
?Inputs:
data[]?:?array?of?complex*?data?points?of?size?2*NFFT+1.
data[0]?is?unused
*?the?n‘th?complex?number?x(n)?for?0?<=?n?<=?length(x)-1?is?stored?as:
data[2*n+1]?=?real(x(n))
data[2*n+2]?=?imag(x(n))
if?length(Nx)?
評(píng)論
共有 條評(píng)論