Struct OtaRoot
pub struct OtaRoot {
pub model: OtaModel,
/* private fields */
}Expand description
OTA nonlinear root for WDF trees.
Models the transconductance amplifier as a current-output device.
The output current follows a tanh transfer characteristic:
Iout = Iabc * tanh(Vin / (2*Vt))
The bias current Iabc controls the gain — this is the compression mechanism in OTA compressors. An envelope follower generates a control signal that reduces Iabc as the input gets louder, creating automatic gain reduction.
For the WDF constraint, the OTA output current flows through the load resistor, creating the voltage that the rest of the tree sees.
Fields§
§model: OtaModelImplementations§
§impl OtaRoot
impl OtaRoot
pub fn new(model: OtaModel) -> OtaRoot
pub fn set_iabc(&mut self, iabc: f64)
pub fn set_iabc(&mut self, iabc: f64)
Set the amplifier bias current (external control from envelope, LFO, etc.).
In a compressor circuit, higher envelope = lower Iabc = less gain. Range: 0 to iabc_max.
pub fn set_gain_normalized(&mut self, gain: f64)
pub fn set_gain_normalized(&mut self, gain: f64)
Set gain as a normalized value (0.0 = off, 1.0 = max gain).
This is a convenience wrapper for compressor-style control: the envelope follower output (0-1) directly maps to gain reduction.
pub fn output_current(&self, v_in: f64) -> f64
pub fn output_current(&self, v_in: f64) -> f64
Compute the OTA output current for a given input voltage.
Uses the tanh transfer characteristic of the differential pair:
Iout = Iabc * tanh(Vin / (2*Vt))
pub fn transconductance(&self) -> f64
pub fn transconductance(&self) -> f64
Compute the transconductance (gm) at the current bias point.
gm = Iabc / (2 * Vt) — this is the small-signal gain. For CA3080 at Iabc=500µA: gm ≈ 9.7 mA/V (≈ 9.7 mS)