get_window

Function get_window 

Source
pub fn get_window<T>(window: T, n: usize, sym: bool) -> FFTResult<Array1<f64>>
where T: Into<WindowParam>,
Expand description

Get a window of the specified type and length.

§Arguments

  • window - Window type or name
  • n - Window length
  • sym - Whether the window is symmetric (default: true)

§Returns

A vector containing the window values.

§Examples

use scirs2_fft::window::{Window, get_window};

// Create a Hann window
let win = get_window(Window::Hann, 10, true).unwrap();
assert_eq!(win.len(), 10);

// Create a Kaiser window with beta=8.6
let win = get_window(Window::Kaiser(8.6), 10, true).unwrap();
assert_eq!(win.len(), 10);

// Create a window by name
let win = get_window("hamming", 10, true).unwrap();
assert_eq!(win.len(), 10);