pub fn hanning(m: usize) -> Array<f64>Expand description
Equivalent of np.hanning(M): the Hann window of m points (m = 0 is empty, m = 1 is [1]).
use rustnum as np;
let w = np::hanning(5).to_vec();
for (g, e) in w.iter().zip([0.0, 0.5, 1.0, 0.5, 0.0]) {
assert!((g - e).abs() < 1e-15);
}
assert!(np::hanning(0).is_empty());
assert_eq!(np::hanning(1).to_vec(), [1.0]);