pub struct Step<S: Scalar> {
pub magnitude: S,
pub time: S,
pub smoothing: Option<S>,
}Expand description
Step function signal.
Returns 0 for t < time, and magnitude for t >= time. Optionally applies smooth transition using tanh.
§Example
use numra_core::signal::{Signal, Step};
let step: Step<f64> = Step::new(1.0, 2.0); // Unit step at t=2
assert!(step.eval(1.0).abs() < 1e-10); // Before step
assert!((step.eval(3.0) - 1.0).abs() < 1e-10); // After stepFields§
§magnitude: S§time: S§smoothing: Option<S>Smoothing parameter (None = sharp step)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Step<S>where
S: Freeze,
impl<S> RefUnwindSafe for Step<S>where
S: RefUnwindSafe,
impl<S> Send for Step<S>
impl<S> Sync for Step<S>
impl<S> Unpin for Step<S>where
S: Unpin,
impl<S> UnsafeUnpin for Step<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Step<S>where
S: UnwindSafe,
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