Enum OpAmpMode
pub enum OpAmpMode {
Inverting {
gain: f64,
},
NonInverting {
gain: f64,
},
}Expand description
Op-amp nonlinear root for WDF trees.
Models the op-amp as a voltage-controlled voltage source:
Vout = Aol * (Vp - Vm)
For a unity-gain buffer (voltage follower), Vm = Vout (direct feedback), which creates the familiar virtual short between inputs. The Newton-Raphson solver finds the output voltage that satisfies both the op-amp equation and the WDF constraint.
Usage in Phase 90 all-pass stages: Each op-amp is configured as a unity-gain buffer (neg tied to out). Op-amp topology mode.
Both topologies use the same op-amp model (nullor/VCVS). The difference is where the input signal enters relative to the feedback path:
-
Inverting: Input to V- through Ri, V+ grounded. Gain = -Rf/Ri. Input comes from WDF wave variable (the virtual ground at V-).
-
NonInverting: Input to V+, feedback to V-. Gain = 1 + Rf/Ri. Input set via
set_vp(). Unity-gain buffer is NonInverting with gain=1.
Variants§
Inverting
Inverting amplifier: Vout = -gain * Vin Input comes from WDF wave variable (virtual ground at V-).
NonInverting
Non-inverting amplifier: Vout = gain * Vp
Input set via set_vp(). Unity buffer = gain of 1.0.