pub fn hann(window: &mut [f32]) {
let n = window.len();
for (i, w) in window.iter_mut().enumerate() {
let x = core::f32::consts::TAU * i as f32 / (n - 1) as f32;
*w = 0.5 * (1.0 - libm::cosf(x));
}
}
pub fn blackman_harris(window: &mut [f32]) {
let n = window.len();
let a0 = 0.35875;
let a1 = 0.48829;
let a2 = 0.14128;
let a3 = 0.01168;
for (i, w) in window.iter_mut().enumerate() {
let x = core::f32::consts::TAU * i as f32 / (n - 1) as f32;
*w = a0 - a1 * libm::cosf(x) + a2 * libm::cosf(2.0 * x) - a3 * libm::cosf(3.0 * x);
}
}