資源簡介
快速傅里葉變換FFT算法完整實現C++代碼
附帶詳細注釋和數十組測試數據
代碼片段和文件信息
/************************************************
*?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)?
評論
共有 條評論