libsidplayfp  2.0.2
Public Member Functions | List of all members
reSIDfp::OpAmp Class Reference

#include <OpAmp.h>

Public Member Functions

 OpAmp (const Spline::Point opamp[], int opamplength, double kVddt)
 
void reset () const
 
double solve (double n, double vi) const
 

Detailed Description

Find output voltage in inverting gain and inverting summer SID op-amp circuits, using a combination of Newton-Raphson and bisection.

           ---R2--
          |       |
vi ---R1-----[A>----- vo
          vx

From Kirchoff's current law it follows that

IR1f + IR2r = 0

Substituting the triode mode transistor model K*W/L*(Vgst^2 - Vgdt^2) for the currents, we get:

n*((Vddt - vx)^2 - (Vddt - vi)^2) + (Vddt - vx)^2 - (Vddt - vo)^2 = 0

Our root function f can thus be written as:

f = (n + 1)*(Vddt - vx)^2 - n*(Vddt - vi)^2 - (Vddt - vo)^2 = 0

Using substitution constants

a = n + 1
b = Vddt
c = n*(Vddt - vi)^2

the equations for the root function and its derivative can be written as:

f = a*(b - vx)^2 - c - (b - vo)^2
df = 2*((b - vo)*dvo - a*(b - vx))

Constructor & Destructor Documentation

◆ OpAmp()

reSIDfp::OpAmp::OpAmp ( const Spline::Point  opamp[],
int  opamplength,
double  kVddt 
)
inline

Opamp input -> output voltage conversion

Parameters
opampopamp mapping table as pairs of points (in -> out)
opamplengthlength of the opamp array
kVddttransistor dt parameter (in volts)

Member Function Documentation

◆ solve()

double reSIDfp::OpAmp::solve ( double  n,
double  vi 
) const

Solve the opamp equation for input vi in loading context n

Parameters
nthe ratio of input/output loading
viinput
Returns
vo

The documentation for this class was generated from the following files: