;Generate hanning window function of buffer_size N
(bind-func hamming_window_func:[void,float*,i64]*
(lambda (wn:float* N:i64)
(let ((n:i64 0))
(dotimes (n N)
(pset! wn n (- 0.54 (* 0.46 (cos (/ (* TWOPIf (i64tof n)) (i64tof (- N 1))))))))
(pset! wn 0 (/ (pref wn 0) 2.0))
(pset! wn (- N 1) (/ (pref wn (- N 1)) 2.0))
void)))