Skip to main content

OtaRoot

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: OtaModel

Implementations§

§

impl OtaRoot

pub fn new(model: OtaModel) -> OtaRoot

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 iabc(&self) -> f64

Get current amplifier bias current.

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

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

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)

Trait Implementations§

§

impl Clone for OtaRoot

§

fn clone(&self) -> OtaRoot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Copy for OtaRoot

§

impl Debug for OtaRoot

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl NlDeviceIv for OtaRoot

§

fn iv(&self, v: f64) -> (f64, f64)

OTA I-V characteristic for multi-NL MNA solver.

Returns (Iout, dIout/dVdiff) where:

  • Iout = Iabc * tanh(v / (2*Vt))
  • dIout/dVdiff = Iabc / (2*Vt) * sech²(v / (2*Vt))
§

fn v_clamp(&self) -> (f64, f64)

OTA differential input clamp: ±200mV (well beyond hard saturation at ~40mV).

§

impl WdfRoot for OtaRoot

§

fn process(&mut self, a: f64, rp: f64) -> f64

OTA transconductance: i = Iabc * tanh(v / (2·Vt))

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more