pub enum FourierConvention {
NonUnitaryAngular,
UnitaryAngular,
Ordinary,
}Expand description
Normalisation convention of the Fourier transform pair.
See the module documentation for the defining integrals.
use symplex::prelude::*;
use symplex::fourier_transform::FourierConvention;
let ctx = Context::new();
let t = ctx.symbol("t");
let w = ctx.symbol("w");
let f = (-t.abs()).exp();
// Non-unitary angular (default): 2/(1 + w²)
let fa = f.fourier_transform(&t, &w).unwrap();
assert_eq!(format!("{fa}"), "2/(w^2 + 1)");
// Unitary angular: √(2/π)/(1 + w²)
let fu = f
.fourier_transform_with(&t, &w, FourierConvention::UnitaryAngular)
.unwrap();
let ratio = (&fu / &fa).subs(&w, &ctx.int(1)).eval_f64().unwrap();
assert!((ratio - 1.0 / (2.0 * std::f64::consts::PI).sqrt()).abs() < 1e-12);Variants§
NonUnitaryAngular
F(ω) = ∫ f(t) e^{−iωt} dt, f(t) = (1/2π) ∫ F(ω) e^{iωt} dω.
The convention of most engineering and physics texts; the default.
UnitaryAngular
F(ω) = (1/√(2π)) ∫ f(t) e^{−iωt} dt with the symmetric inverse.
Ordinary
F(ν) = ∫ f(t) e^{−2πiνt} dt, f(t) = ∫ F(ν) e^{2πiνt} dν
(ordinary frequency ν in hertz).
Trait Implementations§
Source§impl Clone for FourierConvention
impl Clone for FourierConvention
impl Copy for FourierConvention
Source§impl Debug for FourierConvention
impl Debug for FourierConvention
Source§impl Default for FourierConvention
impl Default for FourierConvention
impl Eq for FourierConvention
Source§impl Hash for FourierConvention
impl Hash for FourierConvention
Source§impl PartialEq for FourierConvention
impl PartialEq for FourierConvention
impl StructuralPartialEq for FourierConvention
Auto Trait Implementations§
impl Freeze for FourierConvention
impl RefUnwindSafe for FourierConvention
impl Send for FourierConvention
impl Sync for FourierConvention
impl Unpin for FourierConvention
impl UnsafeUnpin for FourierConvention
impl UnwindSafe for FourierConvention
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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 more