Menu

#1696 Adjustments for the reSID 1.0 new filter

v3.x
open-need-info
gpz
None
ReSID (new 8580 filters)
2023-06-01
2022-02-06
bozz64
No

I did some measures with reSID 1.0, in particular the new filter in filter8580new.cc.
I found out that the filter model for 6581 needs one adjustment regarding the DC level to boost the digi output a bit.
I've measured this with real 6581 SID chips and it was clear that real 6581 SIDs have a bit louder digi playback in proportion with the voice output.
DC level value 5.0 needs to be changed to value 5.35.

This can be tested by e.g. songs of Chris Hülsbeck that play voices and digis together.

I also did measurements for the 8580 filter. There the overall volume is too low. Especially when you compare it with the 6581 output.
Just play a song that doesn't use any filter, e.g.:

/MUSICIANS/H/Hubbard_Rob/Commando.sid

and play it as 6581 and then as 8580.

I've measured output levels of the same song on a real 6581 and 8580 and how it is configured now is wrong.

To fix this, the first value of the 8580 filter needs to change from 0.2 to 0.5. This will increase the volume a lot and some heavy filtered tunes might clip because of this.
Therefore transistor parameter value 9.09 needs to be increased to value 13.0.

The new values can be tested with tunes like:

/MUSICIANS/L/Linus/64_Forever.sid
/MUSICIANS/J/Jammer/Yet_Bigger_Beat_2SID.sid

The current DC level of the 8580 is set to 4.80. This is needed to make digi playback without using the 3 voices on a 8580 audible but very soft.
However, the current value is problematic for the following tune:

/MUSICIANS/P/Psych858o/90_Seconds.sid

Notice that you will hear a tone at the beginning which shouldn't be there. On a real 8580 the tone is not there.

The problem can be fixed to change value 4.80 to 4.84. This value still gives the right low volume output of digi playback via $D418.
I've tested this on sound cards at 44.1KHz and on 48KHz and the tone is not audible anymore with the new value 4.84.

The last change I would suggest is to change the second transistor parameter value 0.80. This needs to change to value 1.0 to make the filter sound the same as a real 8580.
I've tested this with tunes s.a.:
/MUSICIANS/P/Psych858o/90_Seconds.sid at 0:07 for the bass sound.

For the complete change in file filter8580new.cc:

static model_filter_init_t model_filter_init[2] = {
  {
    opamp_voltage_6581,
    sizeof(opamp_voltage_6581)/sizeof(*opamp_voltage_6581),
    // The dynamic analog range of one voice is approximately 1.5V,
    1.5,
    // riding at a DC level of approximately 5.0V.
    5.35,
    // Capacitor value.
    470e-12,
    // Transistor parameters.
    12.18,
    1.31,
    26.0e-3,
    1.0,
    20e-6,
    9.0/1.0,
    1.0/115,
    // DAC parameters.
    6.65,
    2.63,
    2.20,
    false
  },
  {
    opamp_voltage_8580,
    sizeof(opamp_voltage_8580)/sizeof(*opamp_voltage_8580),
    0.5,
    // The 4.75V voltage for the virtual ground is generated by a PolySi resistor divider
    4.84,
    // Capacitor value.
    22e-9,
    // Transistor parameters.
    13.0,
    1.0,
    26.0e-3,
    1.0,   // Unused, leave at 1
    100e-6,
    // FIXME: 6581 only
    0,
    0,
    0,
    0,
    2.00,
    true
  }

Discussion

<< < 1 2 (Page 2 of 2)
  • bozz64

    bozz64 - 2023-05-03

    ok, then I can conclude that you didn't test the values I provided (without the patches that were done later). The tune you mentioned doesn't clip with the values I provided and doesn't have an annoying distortion.

    I just want to say that I focused on the output (not if the values make sense) and proof that we can actually get the right result on a 8580 with the implementation from February 2022. I was hoping that you could figure out why it worked out well and fix the implementation and then work towards values that makes sense.

    Also playing /MUSICIANS/L/Linus/64_Forever.sid on a real 8580 gives a lot of distortion at the beginning and I think this tune is made with an emulated SID instead of a real 8580.

     
    • Leandro Nini

      Leandro Nini - 2023-05-04

      ok, then I can conclude that you didn't test the values I provided (without the patches that were done later). The tune you mentioned doesn't clip with the values I provided and doesn't have an annoying distortion.

      You're right, but I see no point in trying out unrealistic values

       
  • gpz

    gpz - 2023-05-03

    Also playing /MUSICIANS/L/Linus/64_Forever.sid on a real 8580 gives a lot of distortion at the beginning and I think this tune is made with an emulated SID instead of a real 8580.

    I'll send him a message on csdb and ask :)

     
    • gpz

      gpz - 2023-05-04

      He answered:

      ja, GT2. Verzerrt u.U. im Intro (noch bevor die Drums reinkommen) etwas durch den Filter auf allen Stimmen. Wobei ich das, meine ich zumindest, auf der Compo Maschine nicht gehört habe.

      "yes, GT2. Distorts possibly in the intro (before the drums come in) a bit through the filter on all voices. But I have not heard that on the Compo machine, i think."

      Ansonsten, also jenseits des Intros, clipt da nix auf meinem 8580.

      "Besides that, besides the intro, no clipping on my 8580"

       

      Last edit: gpz 2023-05-04
  • Leandro Nini

    Leandro Nini - 2023-05-10

    I can confirm, no clipping nor distortion on the real chip.

    BTW here's the revised patch, was missing a line:

    --- a/src/resid/filter8580new.cc
    +++ b/src/resid/filter8580new.cc
    @@ -204,9 +204,9 @@ static model_filter_init_t model_filter_init[2] = {
         opamp_voltage_8580,
         sizeof(opamp_voltage_8580)/sizeof(*opamp_voltage_8580),
         // FIXME: Measure for the 8580.
    -    0.25,
    -    // The 4.75V voltage for the virtual ground is generated by a PolySi resistor divider
    -    4.80, // FIXME
    +    0.30,
    +    // FIXME: Measure for the 8580.
    +    4.84,
         // Capacitor value.
         22e-9,
         // Transistor parameters.
    @@ -243,6 +243,8 @@ static double log1p(double x)
    
     Filter::model_filter_t Filter::model_filter[2];
    
    +// The 4.75V voltage for the virtual ground is generated by a PolySi resistor divider
    +static const double Vref = 4.75;
    
     // ----------------------------------------------------------------------------
     // Constructor.
    @@ -589,7 +591,7 @@ Filter::Filter()
             // scaled 5 bits
             n_param = (int)(tmp_n_param[1] * 32 + 0.5);
    
    -        double Vgt = (fi.voice_DC_voltage * 1.6) - fi.Vth;
    +        double Vgt = (Vref * 1.6) - fi.Vth;
             nVgt = (int)(N16 * (Vgt - vmin) + 0.5);
    
             // DAC table.
    @@ -649,7 +651,7 @@ void Filter::adjust_filter_bias(double dac_bias)
       // Gate voltage is controlled by the switched capacitor voltage divider
       // Ua = Ue * v = 4.75v  1<v<2
       model_filter_init_t& fi = model_filter_init[1];
    -  double Vg = fi.voice_DC_voltage * (dac_bias*6./100. + 1.6);
    +  double Vg = Vref * (dac_bias*6./100. + 1.6);
       double Vgt = Vg - fi.Vth;
       double vmin = fi.opamp_voltage[0][0];
    
     
  • bozz64

    bozz64 - 2023-05-11

    I can confirm it is actually clipping on a 8580 and therefore it sounds distorted. I've recorded it while playing the song on a real C64 and made sure the recording is not clipping. Just zoom in the audio sample and then it is clear that at certain parts it is clipped.

     
    • Leandro Nini

      Leandro Nini - 2023-05-15

      Yeah, it looks like analog saturation. It doesn't happen for me, but I'm using exSID so it might be the different clock frequency or the voltage, can't say for sure. Will post a recording later. @gpz do you have an 8580 equipped C64 to check out?

      BTW, any objection applying the above patch? It sounds like a good overall improvement to me.

       
      • gpz

        gpz - 2023-05-15

        do you have an 8580 equipped C64 to check out?

        I do (more than one even) - what exactly do you want me to do? :)

        BTW, any objection applying the above patch? It sounds like a good overall improvement to me.

        As always, if you think it's an improvement, sure. I know close to nothing about this code :)

         
        • Leandro Nini

          Leandro Nini - 2023-05-15

          I do (more than one even) - what exactly do you want me to do? :)

          play /MUSICIANS/L/Linus/64_Forever.sid and see if you experience the same distortion as in the sample bozz64 posted.

          As always, if you think it's an improvement, sure. I know close to nothing about this code :)

          The tunes I've tested sounds louder and with less clipping so it LGTM. Credits to @bozz64 for the suggestion.

           
  • Leandro Nini

    Leandro Nini - 2023-05-16

    This is recorded from an 8580R5 0591

     
    • bozz64

      bozz64 - 2023-05-16

      Thanks for the recording. I think you recorded this from a exSID device? I hear a small difference in frequency which I think is there because of a 1Mhz clock. I also hear a beep at 0:09 which should not be there. Anyway, your 8580 has less distortion but I think we should compare recordings done on real C64 on PAL frequency.

      The recording I did is done on a 8580R5 2087 on a real C64.

       
  • gpz

    gpz - 2023-06-01

    i am - once again - confused as to what to do with this now shrug

    @daglem please comment :)

     
  • Dag Lem

    Dag Lem - 2023-06-01

    You'll have to sort this out without me :)
    All of this has been tweaked considerably since I last worked on it, so I can't comment on it.
    I can however say that there is no such thing as a "correct" DC level - this varies considerably between chips, at least for the 6581. But maybe you can get closer to some kind of average?

     
  • Leandro Nini

    Leandro Nini - 2023-06-01

    The last patch posted above (also attached here) increases the volume and reduces clipping on problematic tunes. It looks to me an overall improvement for the sids I've tested.

    Anyway it seems there's quite some variation for the 8580 too with regard to filter distortion and digi samples volume.

     
  • gpz

    gpz - 2023-06-01

    so which do you want me to apply now? :)

     
    • Leandro Nini

      Leandro Nini - 2023-06-01

      If there's no objection the one I've attached (filter8580-bug1696.patch) is good to go.

       

      Last edit: Leandro Nini 2023-06-01
  • gpz

    gpz - 2023-06-01

    applied in r43937 - so we can close this? :)

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.