?? wordy_bak.txt
字號:
/* Goertzel's algorithm for the disctrete Fourier transform */
#include <math.h>
#include "private.h"
#include "complex.h"
#include "goertzel.h"
#include "myaudio.h"
#define TWOPI (2.0 * M_PI)
goertzel::goertzel(float f)
{ v1 = v2 = v3 = 0.0;
float theta = TWOPI * (f / SAMPLERATE);
w = complex(cos(theta), -sin(theta));
fac = 2.0 * w.re;
}
void goertzel::insert(float x)
{ v1 = v2; v2 = v3;
v3 = fac*v2 - v1 + x;
}
complex goertzel::result()
{ return complex(v3) - (w * complex(v2));
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -