-1
我在這裏得到了代碼: https://naudio.codeplex.com/discussions/270762。我該如何實現Goertzel算法?
戈澤爾算法是這樣的:
public double goertzel(List<double> sngData, long N, float frequency, int samplerate)
{
double skn, skn1, skn2;
skn = skn1 = skn2 = 0;
samplerate = this.sampleRate;
frequency = this.freq;
double c = 2 * pi * frequency/samplerate;
double cosan = Math.Cos(c);
for (int i = 0; i < N; i++)
{
skn2 = skn1;
skn1 = skn;
skn = 2 * cosan * skn1 - skn2 + sngData[i];
}
return skn - Math.Exp(-c) * skn1;
}
我想通過使用算法(在上面的鏈接從波形文件閱讀器)來轉換的音頻數據。我怎樣才能做到這一點?謝謝