libresidfp  1.2.3
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
reSIDfp::Filter6581 Class Referencefinal

#include <Filter6581.h>

Inheritance diagram for reSIDfp::Filter6581:
Inheritance graph
[legend]
Collaboration diagram for reSIDfp::Filter6581:
Collaboration graph
[legend]

Public Member Functions

void setFilterCurve (double curvePosition)
 
- Public Member Functions inherited from reSIDfp::Filter
 Filter (const FilterModelConfig &fmc, const Integrator &hpIntegrator, const Integrator &bpIntegrator)
 
uint16_t clock (Voice &voice1, Voice &voice2, Voice &voice3)
 
void enable (bool enable)
 
void reset ()
 
void writeFC_LO (uint8_t fc_lo)
 
void writeFC_HI (uint8_t fc_hi)
 
void writeRES_FILT (uint8_t res_filt)
 
void writeMODE_VOL (uint8_t mode_vol)
 
void input (int16_t input)
 
void restart ()
 

Static Public Member Functions

static void setFilterRange (double adjustment)
 
static void enableOldCaps (bool enable)
 

Protected Member Functions

void updateCenterFrequency () override
 
void restartIntegrators () override
 
int32_t getNormalizedMixerVoice (float v, uint8_t env) const override
 
- Protected Member Functions inherited from reSIDfp::Filter
void updateResonance (uint8_t res)
 
void updateMixing ()
 
unsigned int getFC () const
 
int32_t getNormalizedVoice (float v, uint8_t env) const
 

Friends

class State
 

Detailed Description

The SID filter is modeled with a two-integrator-loop biquadratic filter, which has been confirmed by Bob Yannes to be the actual circuit used in the SID chip.

Measurements show that excellent emulation of the SID filter is achieved, except when high resonance is combined with high sustain levels. In this case the SID op-amps are performing less than ideally and are causing some peculiar behavior of the SID filter. This however seems to have more effect on the overall amplitude than on the color of the sound.

The theory for the filter circuit can be found in "Microelectric Circuits" by Adel S. Sedra and Kenneth C. Smith. The circuit is modeled based on the explanation found there except that an additional inverter is used in the feedback from the bandpass output, allowing the summer op-amp to operate in single-ended mode. This yields filter outputs with levels independent of Q, which corresponds with the results obtained from a real SID.

We have been able to model the summer and the two integrators of the circuit to form components of an IIR filter. Vhp is the output of the summer, Vbp is the output of the first integrator, and Vlp is the output of the second integrator in the filter circuit.

According to Bob Yannes, the active stages of the SID filter are not really op-amps. Rather, simple NMOS inverters are used. By biasing an inverter into its region of quasi-linear operation using a feedback resistor from input to output, a MOS inverter can be made to act like an op-amp for small signals centered around the switching threshold.

In 2008, Michael Huth facilitated closer investigation of the SID 6581 filter circuit by publishing high quality microscope photographs of the die. Tommi Lempinen has done an impressive work on re-vectorizing and annotating the die photographs, substantially simplifying further analysis of the filter circuit.

The filter schematics below are reverse engineered from these re-vectorized and annotated die photographs. While the filter first depicted in reSID 0.9 is a correct model of the basic filter, the schematics are now completed with the audio mixer and output stage, including details on intended relative resistor values. Also included are schematics for the NMOS FET voltage controlled resistors (VCRs) used to control cutoff frequency, the DAC which controls the VCRs, the NMOS op-amps, and the output buffer.

SID filter / mixer / output

NMOS FET voltage controlled resistor (VCR)

Filter frequency cutoff DAC

"Op-amp" (self-biased NMOS inverter)

Output buffer (NMOS voltage follower)

Member Function Documentation

static void reSIDfp::Filter6581::enableOldCaps ( bool  enable)
inlinestatic

Enable/disable old caps for 6581 model.

Parameters
enabletrue to enable old 2200pF caps, false to use new 470pF caps.
void reSIDfp::Filter6581::setFilterCurve ( double  curvePosition)

Set filter curve type based on single parameter.

Parameters
curvePosition0 .. 1, where 0 sets center frequency low ("dark") and 1 sets it high ("bright"). Default is 0.5
static void reSIDfp::Filter6581::setFilterRange ( double  adjustment)
inlinestatic

Set filter offset and range based on single parameter.

Parameters
adjustment0 .. 1, where 0 sets center frequency low ("dark"), 1 sets it high ("bright"). This also affects the range. Default is 0.5
void reSIDfp::Filter6581::updateCenterFrequency ( )
overrideprotectedvirtual

Set filter cutoff frequency.

Implements reSIDfp::Filter.


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