public abstract class Filter extends Object
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 ----------------------------------------------------------------------------
Modifier and Type | Field and Description |
---|---|
protected float |
_1_div_Q |
protected boolean |
bp
Highpass, bandpass, and lowpass filter modes.
|
protected double |
clockFrequency |
protected int |
fc
Filter cutoff frequency.
|
protected boolean |
filt1 |
protected boolean |
filt2 |
protected boolean |
filt3 |
protected boolean |
filtE |
protected boolean |
hp
Highpass, bandpass, and lowpass filter modes.
|
protected boolean |
lp
Highpass, bandpass, and lowpass filter modes.
|
protected int |
res
Filter resonance.
|
protected float |
resonanceFactor |
protected float |
Vbp |
protected float |
Vhp |
protected float |
Vlp |
protected boolean |
voice3off
Switch voice 3 off.
|
protected float |
vol |
Constructor and Description |
---|
Filter() |
Modifier and Type | Method and Description |
---|---|
protected abstract float |
clock(float v1,
float v2,
float v3,
float vE)
SID clocking - 1 cycle
|
void |
enable(boolean enable)
Enable filter.
|
abstract float[] |
getCurveProperties() |
abstract float[] |
getDistortionProperties() |
protected void |
reset()
SID reset.
|
protected void |
setClockFrequency(double clock) |
abstract void |
setCurveAndDistortionDefaults() |
abstract void |
setCurveProperties(float a,
float b,
float c,
float d) |
abstract void |
setDistortionProperties(float a,
float b,
float c) |
protected abstract void |
updatedCenterFrequency()
Set filter cutoff frequency.
|
protected abstract void |
updatedResonance()
Set filter resonance.
|
protected void |
writeFC_HI(byte fc_hi)
Register functions.
|
protected void |
writeFC_LO(byte fc_lo)
Register functions.
|
protected void |
writeMODE_VOL(byte mode_vol)
Register functions.
|
protected void |
writeRES_FILT(byte res_filt)
Register functions.
|
protected void |
zeroDenormals() |
protected int fc
protected int res
protected boolean filt1
protected boolean filt2
protected boolean filt3
protected boolean filtE
protected boolean voice3off
protected boolean hp
protected boolean bp
protected boolean lp
protected float vol
protected double clockFrequency
protected float Vhp
protected float Vbp
protected float Vlp
protected float _1_div_Q
protected float resonanceFactor
protected abstract float clock(float v1, float v2, float v3, float vE)
v1
- voice 1 inv2
- voice 2 inv3
- voice 3 invE
- external audio inprotected final void zeroDenormals()
public abstract void setCurveAndDistortionDefaults()
public void enable(boolean enable)
enable
- protected void setClockFrequency(double clock)
public abstract float[] getCurveProperties()
public abstract void setCurveProperties(float a, float b, float c, float d)
public abstract float[] getDistortionProperties()
public abstract void setDistortionProperties(float a, float b, float c)
protected final void reset()
protected final void writeFC_LO(byte fc_lo)
fc_lo
- protected final void writeFC_HI(byte fc_hi)
fc_hi
- protected final void writeRES_FILT(byte res_filt)
res_filt
- protected final void writeMODE_VOL(byte mode_vol)
mode_vol
- protected abstract void updatedCenterFrequency()
protected abstract void updatedResonance()
Copyright © 2018 Ken Händel. All rights reserved.