libsidplayfp 2.12.0
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
reSIDfp::FilterModelConfig Class Referenceabstract
Inheritance diagram for reSIDfp::FilterModelConfig:
Inheritance graph
[legend]

Public Member Functions

unsigned short ** getVolume ()
 
unsigned short ** getResonance ()
 
unsigned short ** getSummer ()
 
unsigned short ** getMixer ()
 
unsigned short getOpampRev (int i) const
 
double getVddt () const
 
double getVth () const
 
unsigned short getNormalizedValue (double value) const
 
unsigned short getNormalizedCurrentFactor (double wl) const
 
unsigned short getNVmin () const
 
int getNormalizedVoice (float value, unsigned int env) const
 

Protected Member Functions

 FilterModelConfig (double vvr, double c, double vdd, double vth, double ucox, const Spline::Point *opamp_voltage, int opamp_size)
 
void setUCox (double new_uCox)
 
virtual double getVoiceDC (unsigned int env) const =0
 
void buildSummerTable (const OpAmp &opampModel)
 
void buildMixerTable (const OpAmp &opampModel, double nRatio)
 
void buildVolumeTable (const OpAmp &opampModel, double nDivisor)
 
void buildResonanceTable (const OpAmp &opampModel, const double resonance_n[16])
 

Protected Attributes

const double C
 Capacitor value.
 
const double Vdd
 Positive supply voltage.
 
const double Vth
 Threshold voltage.
 
const double Vddt
 Vdd - Vth.
 
double uCox
 Transconductance coefficient: u*Cox.
 
const double vmin
 
const double vmax
 
const double denorm
 
const double norm
 
const double N16
 Fixed point scaling for 16 bit op-amp output.
 
const double voice_voltage_range
 
double currFactorCoeff
 Current factor coefficient for op-amp integrators.
 
unsigned short * mixer [8]
 Lookup tables for gain and summer op-amps in output stage / filter.
 
unsigned short * summer [5]
 
unsigned short * volume [16]
 
unsigned short * resonance [16]
 
unsigned short opamp_rev [1<< 16]
 Reverse op-amp transfer function.
 

Static Protected Attributes

static constexpr double Ut = 26.0e-3
 Transistor parameters.
 

Constructor & Destructor Documentation

◆ FilterModelConfig()

reSIDfp::FilterModelConfig::FilterModelConfig ( double vvr,
double c,
double vdd,
double vth,
double ucox,
const Spline::Point * opamp_voltage,
int opamp_size )
protected
Parameters
vvrvoice voltage range
ccapacitor value
vddVdd supply voltage
vththreshold voltage
ucoxu*Cox
opamp_voltageopamp voltage array
opamp_sizeopamp voltage array size

Member Function Documentation

◆ buildMixerTable()

void reSIDfp::FilterModelConfig::buildMixerTable ( const OpAmp & opampModel,
double nRatio )
inlineprotected

The audio mixer operates at n ~ 8/6 (6581) or 8/5 (8580), and has 8 fundamentally different input configurations (0 - 7 input "resistors").

All "on", transistors are modeled as one - see comments above for the filter summer.

◆ buildResonanceTable()

void reSIDfp::FilterModelConfig::buildResonanceTable ( const OpAmp & opampModel,
const double resonance_n[16] )
inlineprotected

4 bit "resistor" ladders in the bandpass resonance gain necessitate 16 gain tables. From die photographs of the bandpass "resistor" ladders it follows that 1/Q ~ ~res/8 (6581) or 2^((4 - res)/8) (8580) (assuming ideal op-amps and ideal "resistors").

◆ buildSummerTable()

void reSIDfp::FilterModelConfig::buildSummerTable ( const OpAmp & opampModel)
inlineprotected

The filter summer operates at n ~ 1, and has 5 fundamentally different input configurations (2 - 6 input "resistors").

Note that all "on" transistors are modeled as one. This is not entirely accurate, since the input for each transistor is different, and transistors are not linear components. However modeling all transistors separately would be extremely costly.

◆ buildVolumeTable()

void reSIDfp::FilterModelConfig::buildVolumeTable ( const OpAmp & opampModel,
double nDivisor )
inlineprotected

4 bit "resistor" ladders in the audio output gain necessitate 16 gain tables. From die photographs of the volume "resistor" ladders it follows that gain ~ vol/12 (6581) or vol/16 (8580) (assuming ideal op-amps and ideal "resistors").

◆ getVoiceDC()

virtual double reSIDfp::FilterModelConfig::getVoiceDC ( unsigned int env) const
protectedpure virtual

Member Data Documentation

◆ Ut

constexpr double reSIDfp::FilterModelConfig::Ut = 26.0e-3
staticconstexprprotected

Transistor parameters.

Thermal voltage: Ut = kT/q = 8.61734315e-5*T ~ 26mV


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