ferray_window/lib.rs
1//! Window functions and functional programming utilities for ferray.
2//!
3//! This crate provides NumPy-equivalent window functions for signal processing
4//! and spectral analysis (`bartlett`, `blackman`, `hamming`, `hanning`, `kaiser`),
5//! along with functional programming utilities (`vectorize`, `piecewise`,
6//! `apply_along_axis`, `apply_over_axes`).
7//!
8//! All window functions return `Array1<f64>` and match `NumPy`'s output to
9//! high precision.
10
11// Window functions evaluate analytic formulae over `usize`-indexed grids
12// and produce `f64` tap weights; the integer-to-float lift is intrinsic
13// to the math, and oracle tests compare endpoint values against analytic
14// closed forms via exact equality.
15#![allow(
16 clippy::cast_possible_truncation,
17 clippy::cast_possible_wrap,
18 clippy::cast_precision_loss,
19 clippy::cast_sign_loss,
20 clippy::cast_lossless,
21 clippy::float_cmp,
22 clippy::missing_errors_doc,
23 clippy::missing_panics_doc,
24 clippy::many_single_char_names,
25 clippy::similar_names,
26 clippy::items_after_statements,
27 clippy::option_if_let_else,
28 clippy::too_long_first_doc_paragraph,
29 clippy::needless_pass_by_value,
30 clippy::match_same_arms,
31 clippy::suboptimal_flops
32)]
33
34pub mod functional;
35pub mod windows;
36
37// Re-export window functions at crate root for convenience
38pub use windows::{
39 bartlett, blackman, cosine, exponential, gaussian, general_cosine, general_hamming, hamming,
40 hanning, kaiser, nuttall, parzen, taylor, tukey,
41};
42
43// Re-export functional utilities at crate root. `vectorize_nd` was
44// removed as a redundant alias for `vectorize` — vectorize itself is
45// generic over dimension (#293).
46pub use functional::{apply_along_axis, apply_over_axes, piecewise, sum_axis_keepdims, vectorize};