pub enum FftNormalization {
None,
Backward,
Ortho,
Forward,
}Expand description
Normalization mode for FFT
§Default: Backward
The default normalization mode is Backward, which matches NumPy’s numpy.fft
behavior. This means:
- Forward FFT: no normalization (factor = 1)
- Inverse FFT: divide by N (factor = 1/N)
This ensures that ifft(fft(x)) == x (roundtrip identity).
§Comparison Table
| Mode | Forward Factor | Inverse Factor | Roundtrip |
|---|---|---|---|
| None | 1 | 1 | ifft(fft(x)) = N*x |
| Backward | 1 | 1/N | ifft(fft(x)) = x |
| Ortho | 1/√N | 1/√N | ifft(fft(x)) = x |
| Forward | 1/N | 1 | ifft(fft(x)) = x |
Variants§
None
No normalization (forward: 1, inverse: 1)
Warning: Roundtrip produces N * x. Use when you need unnormalized
raw FFT output, such as for convolution or custom post-processing.
Backward
Normalize inverse by 1/N (forward: 1, inverse: 1/N)
Default mode. Matches numpy.fft behavior.
Roundtrip: ifft(fft(x)) == x
Ortho
Normalize both by 1/sqrt(N) (forward: 1/√N, inverse: 1/√N)
Makes FFT and IFFT symmetric. Preserves Parseval’s theorem:
sum(|x|²) == sum(|X|²) (energy conservation).
Useful for signal processing where symmetry matters.
Forward
Normalize forward by 1/N (forward: 1/N, inverse: 1)
Opposite of Backward. Roundtrip: ifft(fft(x)) == x
Implementations§
Source§impl FftNormalization
impl FftNormalization
Sourcepub fn factor(self, direction: FftDirection, n: usize) -> f64
pub fn factor(self, direction: FftDirection, n: usize) -> f64
Get the normalization factor for a given direction and size
Trait Implementations§
Source§impl Clone for FftNormalization
impl Clone for FftNormalization
Source§fn clone(&self) -> FftNormalization
fn clone(&self) -> FftNormalization
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FftNormalization
impl Debug for FftNormalization
Source§impl Default for FftNormalization
impl Default for FftNormalization
Source§fn default() -> FftNormalization
fn default() -> FftNormalization
Source§impl PartialEq for FftNormalization
impl PartialEq for FftNormalization
impl Copy for FftNormalization
impl Eq for FftNormalization
impl StructuralPartialEq for FftNormalization
Auto Trait Implementations§
impl Freeze for FftNormalization
impl RefUnwindSafe for FftNormalization
impl Send for FftNormalization
impl Sync for FftNormalization
impl Unpin for FftNormalization
impl UnsafeUnpin for FftNormalization
impl UnwindSafe for FftNormalization
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.