Fix bugs in AKF detection

Add CWavFile.cs for reading wav files
Add more test cases
This commit is contained in:
Flamefire committed 2014-04-09 18:28:35 +02:00
1 parent 614a7e0ed2
commit d584206a7f
9 files changed
+524 -17

No files matched your search

+6 -3
View File
@@ -7,7 +7,8 @@ public:
PtAKF(unsigned step);
~PtAKF();
void input(short* begin, short* end){
/** Add input data to buffer. This is thread-safe (against other functions). **/
template <typename InIt> void input(InIt begin, InIt end) {
_AnalysisBuf.insert(begin, end);
}
@@ -17,12 +18,14 @@ private:
static int _InitCount;
static float* _SamplesPerPeriodPerTone;
static constexpr int _MinHalfTone = 0; //C2
static constexpr int _MaxHalfTone = 47; //B5
static constexpr int _MaxHalfTone = 55;//47; //B5
static constexpr int _HalfTonesAdd = 4; //Additonal half tones to analyze to remove the peak at lag 0
constexpr static size_t _SampleCt = 4096;
constexpr static size_t _SampleCt = 2048;
RingBuffer<_SampleCt * 2> _AnalysisBuf;
unsigned _Step;
static int _GetNote(float* samples, double* maxVolume, float* weights);
static float _AnalyzeToneFunc(float* samples, int toneIndex);
static float _FastAKF(float* samples, float samplesPerPeriodD);
};