lib_jsl_dsp/discrete/windows/hann.rs
1use super::hamming::general_hamming;
2
3/// The Hanning window, also known as the Hann window, is defined by a specific set of coefficients that provide a smooth tapering of the coefficients based on the position within the window. The coefficients are computed using the general cosine function with specific values to achieve the desired shape and spectral properties.
4pub fn hann(m: usize, sym: bool) -> Vec<f64> {
5 general_hamming(m, 0.5, sym)
6}
7
8#[cfg(test)]
9mod tests {
10 use super::*;
11 use crate::discrete::windows::test_support::assert_window;
12
13 #[test]
14 fn test_hann() {
15 assert_window(include_str!("../test_data/hann.csv"), hann(7, true));
16 }
17}