scirs2_fft/hfft/mod.rs
1//! Hermitian Fast Fourier Transform (HFFT) module
2//!
3//! This module provides functions for computing the Hermitian Fast Fourier Transform (HFFT)
4//! and its inverse (IHFFT). These functions handle complex-valued signals with real spectra.
5//!
6//! ## Implementation Notes
7//!
8//! The HFFT functions are particularly sensitive to numerical precision issues due to their
9//! reliance on Hermitian symmetry properties. When using these functions:
10//!
11//! 1. **Normalization**: Pay close attention to the normalization parameter, as it significantly
12//! affects scaling in round-trip transformations.
13//!
14//! 2. **Precision**: Hermitian symmetry requires that the imaginary part of certain components
15//! be exactly zero, which may not be possible due to floating-point precision. The functions
16//! apply reasonable tolerances to handle these cases.
17//!
18//! 3. **Round-Trip Transformations**: When performing hfft followed by ihfft (or vice versa),
19//! you may need to apply scaling factors to recover the original signal amplitudes accurately.
20//!
21//! 4. **Multi-dimensional Transforms**: 2D and N-dimensional transforms have additional complexity
22//! regarding Hermitian symmetry across multiple dimensions. Care should be taken when working
23//! with these functions.
24
25// Module declarations
26mod complex_to_real;
27mod real_to_complex;
28mod symmetric;
29mod utility;
30
31// Re-exports
32pub use complex_to_real::{hfft, hfft2, hfftn};
33pub use real_to_complex::{ihfft, ihfft2, ihfftn};
34pub use symmetric::{
35 create_hermitian_symmetric_signal, enforce_hermitian_symmetry, enforce_hermitian_symmetry_nd,
36 is_hermitian_symmetric,
37};