资源简介
Goertzel算法,当时查找资料时在本论坛发现的,现分享出来
代码片段和文件信息
#define SAMPLING_RATE 8000
#define MAX_BINS 8
#define GOERTZEL_N 92
int sample_count;
double q1[ MAX_BINS ];
double q2[ MAX_BINS ];
double r[ MAX_BINS ];
/*
* coef = 2.0 * cos( (2.0 * PI * k) / (float)GOERTZEL_N)) ;
* Where k = (int) (0.5 + ((float)GOERTZEL_N * target_freq) / SAMPLING_RATE));
*
* More simply: coef = 2.0 * cos( (2.0 * PI * target_freq) / SAMPLING_RATE );
*/
double freqs[ MAX_BINS] =
{
697
770
852
941
1209
1336
1477
1633
};
double coefs[ MAX_BINS ] ;
/*----------------------------------------------------------------------------
* calc_coeffs
*----------------------------------------------------------------------------
* This is where we calculate t
评论
共有 条评论