Skip to main content

almost_identity

Function almost_identity 

Source
pub fn almost_identity<T: Number + Float>(x: T, m: T, n: T) -> T
Expand description

returns soft clipping (in a cubic fashion) of x; let m be the threshold (anything above m stays unchanged), and n the value things will take when the signal is zero