pub struct OpAmp<T: Transcendental> { /* private fields */ }Expand description
Operational amplifier model with slew-rate limiting, bandwidth roll-off, and voltage rail clamping.
Implementations§
Source§impl<T: Transcendental> OpAmp<T>
impl<T: Transcendental> OpAmp<T>
Sourcepub fn new(gain: f64, slew_rate: f64, bandwidth: f64) -> Self
pub fn new(gain: f64, slew_rate: f64, bandwidth: f64) -> Self
Create a new op-amp model.
gain— open-loop gain (V/V)slew_rate— slew rate in V/µsbandwidth— gain-bandwidth product (Hz)
Sourcepub fn process(&mut self, input: T, dt: T) -> T
pub fn process(&mut self, input: T, dt: T) -> T
Process one sample.
input— differential input voltagedt— sample period in seconds
Sourcepub fn output_voltage(&self) -> T
pub fn output_voltage(&self) -> T
Current output voltage.
Trait Implementations§
Source§impl<T: Transcendental> WdfElement<T> for OpAmp<T>
impl<T: Transcendental> WdfElement<T> for OpAmp<T>
Source§fn port_resistance(&self) -> T
fn port_resistance(&self) -> T
Port resistance
Source§fn process_incident(&mut self, a: T) -> T
fn process_incident(&mut self, a: T) -> T
Process incident wave, return reflected wave
Source§fn update_state(&mut self)
fn update_state(&mut self)
Update internal state (called after wave computation)
Auto Trait Implementations§
impl<T> Freeze for OpAmp<T>where
T: Freeze,
impl<T> RefUnwindSafe for OpAmp<T>where
T: RefUnwindSafe,
impl<T> Send for OpAmp<T>
impl<T> Sync for OpAmp<T>
impl<T> Unpin for OpAmp<T>where
T: Unpin,
impl<T> UnsafeUnpin for OpAmp<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for OpAmp<T>where
T: 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