Function rectangular

Source
pub fn rectangular(width: usize) -> Window
Expand description

Compute a simple rectangular window, a.k.a. boxcar or Dirichlet window

Example

use dsp::window;
 
let win = window::rectangular(3);
let frame = vec![1.0; 3];
let mut output = vec![0.0; 3];
win.apply(&frame, &mut output);
assert_eq!(output, vec![1.0, 1.0, 1.0]);