我正在尝试复制此处看到的功能:http ://en.wikipedia.org/wiki/Window_function#Blackman.E2.80.93Harris_window
但我根本无法理解价值。这是我当前的代码:
double blackman_harris(int n, int N){
double a0, a1, a2, a3, seg1, seg2, seg3, w_n;
a0 = 0.35875;
a1 = 0.48829;
a2 = 0.14128;
a3 = 0.01168;
seg1 = a1 * (double) cos((double)(2*M_PI*n)/(double) (N - 1));
seg2 = a2 * (double) cos((double)(4*M_PI*n)/(double) (N - 1));
seg3 = a3 * (double) cos((double)(6*M_PI*n)/(double) (N - 1));
w_n = a0 - seg1 + seg2 - seg3;
return w_n;
}
非常感谢您的帮助。