pub enum NoiseShaperCurve {
Lipshitz5,
FWeighted9,
ModifiedE9,
ImprovedE9,
TpdfOnly,
}Expand description
Noise shaping curve presets All coefficients from SoX src/dither.c, NTF zeros verified |z| < 1
Variants§
Lipshitz5
Lipshitz 5-tap - general purpose, works well at 44.1/48kHz NTF max|z| = 0.961, 4kHz notch -27.2dB
FWeighted9
F-weighted 9-tap - psychoacoustically optimized for 44.1kHz Deepest notch in 2-5kHz region (human hearing most sensitive) NTF max|z| = 0.914
ModifiedE9
Modified-E 9-tap - moderate high-frequency push NTF max|z| = 0.916
ImprovedE9
Improved-E 9-tap - most aggressive HF noise shaping NTF max|z| = 0.959
TpdfOnly
Pure TPDF only, no noise shaping Recommended for 96kHz+ where shaping benefit diminishes
Implementations§
Source§impl NoiseShaperCurve
impl NoiseShaperCurve
Sourcepub fn auto_select(sample_rate: u32) -> Self
pub fn auto_select(sample_rate: u32) -> Self
Auto-select curve based on sample rate
- 44.1kHz: Lipshitz5 (safe default)
- 48kHz: Lipshitz5 (acceptable 8.8% offset)
- 88.2/96kHz+: TpdfOnly (shaping benefit diminishes)
Sourcepub fn coeffs(&self) -> [f64; 9]
pub fn coeffs(&self) -> [f64; 9]
Get verified SoX coefficients Returns 9-element array (lower-order curves pad with zeros)
Sourcepub fn is_recommended_for(&self, sample_rate: u32) -> bool
pub fn is_recommended_for(&self, sample_rate: u32) -> bool
Check if this curve is recommended for given sample rate Unified boundary at 50_000 Hz based on NTF degradation analysis:
- At 48kHz: all curves have ≤6dB 4kHz notch degradation (acceptable)
- At 88.2kHz: only FWeighted9/ImprovedE9 stay ≤6dB, others exceed
- Conservative choice: recommend TpdfOnly for all rates >50kHz
Trait Implementations§
Source§impl Clone for NoiseShaperCurve
impl Clone for NoiseShaperCurve
Source§fn clone(&self) -> NoiseShaperCurve
fn clone(&self) -> NoiseShaperCurve
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NoiseShaperCurve
Source§impl Debug for NoiseShaperCurve
impl Debug for NoiseShaperCurve
Source§impl Default for NoiseShaperCurve
impl Default for NoiseShaperCurve
Source§fn default() -> NoiseShaperCurve
fn default() -> NoiseShaperCurve
Source§impl<'de> Deserialize<'de> for NoiseShaperCurve
impl<'de> Deserialize<'de> for NoiseShaperCurve
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for NoiseShaperCurve
Source§impl From<NoiseShaperCurve> for u8
impl From<NoiseShaperCurve> for u8
Source§fn from(curve: NoiseShaperCurve) -> Self
fn from(curve: NoiseShaperCurve) -> Self
Source§impl From<u8> for NoiseShaperCurve
impl From<u8> for NoiseShaperCurve
Source§impl PartialEq for NoiseShaperCurve
impl PartialEq for NoiseShaperCurve
Source§fn eq(&self, other: &NoiseShaperCurve) -> bool
fn eq(&self, other: &NoiseShaperCurve) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for NoiseShaperCurve
impl Serialize for NoiseShaperCurve
impl StructuralPartialEq for NoiseShaperCurve
Auto Trait Implementations§
impl Freeze for NoiseShaperCurve
impl RefUnwindSafe for NoiseShaperCurve
impl Send for NoiseShaperCurve
impl Sync for NoiseShaperCurve
impl Unpin for NoiseShaperCurve
impl UnsafeUnpin for NoiseShaperCurve
impl UnwindSafe for NoiseShaperCurve
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
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 more