Klasse Filter

java.lang.Object
builder.resid.residfp.Filter
Bekannte direkte Unterklassen:
Filter6581, Filter8580

public abstract class Filter extends Object
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 inverted 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.

Qualified guesses at SID filter schematics are depicted below.

 SID filter
 ----------

     -----------------------------------------------
    |                                               |
    |            ---Rq--                            |
    |           |       |                           |
    |  ------------<A]-----R1---------              |
    | |                               |             |
    | |                        ---C---|      ---C---|
    | |                       |       |     |       |
    |  --R1--    ---R1--      |---Rs--|     |---Rs--|
    |        |  |       |     |       |     |       |
     ----R1--|-----[A>--|--R-----[A>--|--R-----[A>--|
             |          |             |             |
 vi -----R1--           |             |             |

                       vhp           vbp           vlp


 vi  - input voltage
 vhp - highpass output
 vbp - bandpass output
 vlp - lowpass output
 [A> - op-amp
 R1  - summer resistor
 Rq  - resistor array controlling resonance (4 resistors)
 R   - NMOS FET voltage controlled resistor controlling cutoff frequency
 Rs  - shunt resitor
 C   - capacitor



 SID integrator
 --------------

                                   V+

                                   |
                                   |
                              -----|
                             |     |
                             | ||--
                              -||
                   ---C---     ||->
                  |       |        |
                  |---Rs-----------|---- vo
                  |                |
                  |            ||--
 vi ----     -----|------------||
        |   ˆ     |            ||->
        |___|     |                |
        -----     |                |
          |       |                |
          |---R2--                 |
          |
          R1                       V-
          |
          |

          Vw
 ----------------------------------------------------------------------------
 
Autor:
Ken Händel
  • Felddetails

    • enabled

      private boolean enabled
      Filter enabled.
    • fc

      protected int fc
      Filter cutoff frequency.
    • res

      protected int res
      Filter resonance.
    • filt

      private byte filt
      Selects which inputs to route through filter.
    • filt1

      protected boolean filt1
    • filt2

      protected boolean filt2
    • filt3

      protected boolean filt3
    • filtE

      protected boolean filtE
    • voice3off

      protected boolean voice3off
      Switch voice 3 off.
    • hp

      protected boolean hp
      Highpass, bandpass, and lowpass filter modes.
    • bp

      protected boolean bp
      Highpass, bandpass, and lowpass filter modes.
    • lp

      protected boolean lp
      Highpass, bandpass, and lowpass filter modes.
    • vol

      protected float vol
    • clockFrequency

      protected double clockFrequency
    • Vhp

      protected float Vhp
    • Vbp

      protected float Vbp
    • Vlp

      protected float Vlp
    • _1_div_Q

      protected float _1_div_Q
    • resonanceFactor

      protected float resonanceFactor
  • Konstruktordetails

    • Filter

      public Filter()
  • Methodendetails

    • clock

      protected abstract float clock(float v1, float v2, float v3, float vE)
      SID clocking - 1 cycle
      Parameter:
      v1 - voice 1 in
      v2 - voice 2 in
      v3 - voice 3 in
      vE - external audio in
      Gibt zurück:
      filtered output
    • zeroDenormals

      protected final void zeroDenormals()
    • setCurveAndDistortionDefaults

      public abstract void setCurveAndDistortionDefaults()
    • enable

      public void enable(boolean enable)
      Enable filter.
      Parameter:
      enable -
    • setClockFrequency

      protected void setClockFrequency(double clock)
    • getCurveProperties

      public abstract float[] getCurveProperties()
    • setCurveProperties

      public abstract void setCurveProperties(float a, float b, float c, float d)
    • getDistortionProperties

      public abstract float[] getDistortionProperties()
    • setDistortionProperties

      public abstract void setDistortionProperties(float a, float b, float c)
    • reset

      protected final void reset()
      SID reset.
    • writeFC_LO

      protected final void writeFC_LO(byte fc_lo)
      Register functions.
      Parameter:
      fc_lo -
    • writeFC_HI

      protected final void writeFC_HI(byte fc_hi)
      Register functions.
      Parameter:
      fc_hi -
    • writeRES_FILT

      protected final void writeRES_FILT(byte res_filt)
      Register functions.
      Parameter:
      res_filt -
    • writeMODE_VOL

      protected final void writeMODE_VOL(byte mode_vol)
      Register functions.
      Parameter:
      mode_vol -
    • updatedCenterFrequency

      protected abstract void updatedCenterFrequency()
      Set filter cutoff frequency.
    • updatedResonance

      protected abstract void updatedResonance()
      Set filter resonance.