?? fft.h
字號:
#if !defined FFT_H
#define FFT_H
//------------------------------------
// fft.h
// Fast Fourier Transform
// (c) Reliable Software, 1996
//------------------------------------
#include "complex.h"
#include "wassert.h"
class SampleIter;
class Fft
{
public:
Fft (int Points, long sampleRate);
~Fft ();
int Points () const { return _Points; }
void Transform ();
void CopyIn (SampleIter& iter);
double GetIntensity (int i) const
{
Assert (i < _Points);
return _X[i].Mod()/_sqrtPoints;
}
int GetFrequency (int point) const
{
// return frequency in Hz of a given point
Assert (point < _Points);
long x =_sampleRate * point;
return x / _Points;
}
int HzToPoint (int freq) const
{
return (long)_Points * freq / _sampleRate;
}
int MaxFreq() const { return _sampleRate; }
int Tape (int i) const
{
Assert (i < _Points);
return (int) _aTape[i];
}
private:
void PutAt ( int i, double val )
{
_X [_aBitRev[i]] = Complex (val);
}
int _Points;
long _sampleRate;
int _logPoints;
double _sqrtPoints;
int *_aBitRev; // bit reverse vector
Complex *_X; // in-place fft array
Complex **_W; // exponentials
double *_aTape; // recording tape
};
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -