Filter brewing for the Soekris R2R

It's a Tektronix TDS2024C - 4-channel, 200MHz digital storage scope sampling at 2GHz. I have shorted the Tek scope probes and connected to the scope ground test pin. I've also used a bnc/croc clip lead. The scope probe gives about 5-10mV pk-pk of noise, more than I would expect or like to see.
 
Just returned from weekend away from home. Great to see progress continues, thank you! Will have a go one day soon. 'totalCRaP_rev2' was my favourite until I heard '1021filtN3_corr' this evening. May be not quite so open & transparent, talking very small fractions, but somehow cleaner with greater depth to the soundstage. More rounded, may be a bit more subtance to the sound, more 'grown up'? Nice....

agree with your assessment. The newest filter is more flashed out, seems to be more "correct" sounding for lack of better words. Now the bad news is that I am sort of addicted to the amazing transparency and directness in some of the previous filters such as crapMagic. It sometimes make me feel I can reach out and touch the instrument or the singer. Hope the next iterations will bring some of that magic back.
 
Disabled Account
Joined 2005
I think it is a bit too dark and shy in the high end, at least in my maggies, making a lot of small details difficult to hear.

I said earlier that there is something odd going on with this filter that needs investigation.

The filter itself is flat to 17kHz and only down by 0.25dB at 19kHz. That should not sound rolled off in the high end, and definitely shouldn't be taming sibilance at around 12-14kHz.

It is almost as if the filtering is happening at /2 of those frequencies.

The response at the DAC outputs needs to be checked to determine what exactly is happening.

Add: One possibility I need to investigate is that the 0's aren't aligned with the edges of the filter. The minimum length filters at 44.1/48 look like:

Code:
0.000000000264123987332159204754258378088
0
-0.000000001029827857717017005591772041439
-0.000000003118075807570947940620809108033
-0.000000006279773131487785044031427222249
-0.00000001003389015670621257026130036848
-0.000000013244214367597809947685201503991
-0.000000014112574181250413163686738239003
-0.000000010410911898780695833342701725997
0
snip...
0
0.000000000264123987332159204754258378088

So the zero's are offset...

If I manually specify the number of taps as a multiple of 64 (64, 128, 192, 256, ...) the zeros align with the edge of the filter...

Code:
 0                                        
-0.000000000026461002308114785749492865262
-0.000000000087111860737944921769858880735
-0.000000000184840358830717473533818776168
-0.000000000306211152414295543394109988484
-0.000000000415176203019250476840576355477
-0.000000000451757583407256487209776000689
-0.000000000338966339234631596666267159914
 0                                        
snip...
-0.000000000338966339234631596666267159914
-0.000000000451757583407256487209776000689
-0.000000000415176203019250476840576355477
-0.000000000306211152414295543394109988484
-0.000000000184840358830717473533818776168
-0.000000000087111860737944921769858880735
-0.000000000026461002308114785749492865262
 0

I don't know if this will make any difference - but I suspect it may do.
 
Last edited:
Disabled Account
Joined 2005
I don't know if this will make any difference - but I suspect it may do.

The other issue is that the levels sounds a tiny bit shy on the DAM. I think this might be due to the zero's. My guess is it's a similar thing to the single co-efficent NOS filters.

When I process an impulse using SoX the peak level of the up sampled impulse is -10.1dB with Sox's gain set to x8 vs 0dB for the original file. I have to up gain with SoX to x18 for the levels to be within 0.1dB.

I think the DAM has enough headroom in the filters to wind-up the levels but will need to check this out. Possibly this afternoon.
 
Disabled Account
Joined 2005
I've decided the gain correction isn't needed. After comparing with other filters it's not necessary as far as I can tell. I've attached a "zero's first and last" version of the 44.1/48 filter, but not that it sure makes any significant difference.

Also a bonus upload are two additional variants of the IPv4 which I didn't get around to posting earlier.
 

Attachments

  • 1021filtIPv4_p30.skr.zip
    3.7 KB · Views: 116
  • 1021filtIPv4_p35.skr.zip
    3.7 KB · Views: 126
  • NQv3.zip
    10.8 KB · Views: 103
Disabled Account
Joined 2005
You're on fire :)

Some time alone in the morning here. Testing filters. Just uploaded
1021filtIPv4_p35.skr

After 3 minutes of use. It seems quite "spacious" sounding?

Just had some time today where I could have a listen to what is going on ;)

The IPvX filters are pretty good. I could live with most of them, especially the v4_p30 or v4_p35.
The IPv4 filters were done a couple of weeks ago but only one got uploaded, the rest are a catchup.

I've got a version of the Nyquist filters running with the fir2 attenuation (x6.8333) reinstated and I think it might be an improvement over the full x8 gain fir2. I'll have to double check before I post..
 
Last edited:
Can publish TXT filters and 1021filtIPv4_p35.skr and 1021filtIPv4_p30.skr? By knowing the length of the filter, gain, if it keep the original samples ....

The TXT NQv3 has gain 10 in to 44 and 48. It saturate.

And some coefficients are 0 and no decimals are used?
-0.000000000026461002308114785749492865262
-0.000000000087111860737944921769858880735

In the filter 1021filtNqF2.skr I modify F2 gain to 8 instead of 6.833333 and does not saturate. Unless artificial target square wave signals to 0 dB. Sounds very nice and natural, I do not notice loss of detail.
 
Last edited:
The zeros at the end of the filter do not harm, such a filter is equivalent to the filter the two zeros omitted, so two coefficients shorter.

This type of filters has in real infinitely many coefficients getting smaller and smaller. You have to cut at some point, the earlier, the more it is away from the continuous filter of that type. On the other hand it makes no sense to add coefficients below the smallest resolution of the DAM of about 2^{-30}.

The remark of oneclock, to use 0.0 instead of 0 could be worth a try. Soekris stock filter bypasses have as coefficient 1.000. Maybe mkrom is that "stupid" that this is needed.
 
Disabled Account
Joined 2005
Can publish TXT filters and 1021filtIPv4_p35.skr and 1021filtIPv4_p30.skr? By knowing the length of the filter, gain, if it keep the original samples

Nobody was getting knickers moist about "keeping original samples" when they were made, so no they don't.

Attached a unity gain version of the filter with FIR1 and FIR2 set to x8.

I had a suspicion the added gain would clip but didn't have a chance to hook up to test gear. I knew someone would complain if it did. I use digital volume set around V-35 to V-25 for most listening, and can't really wind up the gain to listen if it clips at full gain. :)

I had checked previously that mkrom was smart enough to deal with straight decimals and E notation with no difference in output. I assumed that it could manage 0 or 0.0 without any problem. Nice to hear that is confirmed.
 

Attachments

  • 1021filtIPv4_p35.txt
    40.2 KB · Views: 87
  • 1021filtIPv4_p30.txt
    40.2 KB · Views: 84
  • 1021filtNQv3UG.skr.zip
    2.4 KB · Views: 99
  • 1021filtNQv3UG.txt
    52.1 KB · Views: 89
Disabled Account
Joined 2005
Paul,

what software do you use to generate those beautiful 40-digit coefficients?

MATLAB's filter and design analysis tool. It has a rather nice menu option to export filter co-efficients to text file.

I'd bought a licence in a moment of weakness, and initially had buyers remorse but the more I use it, the more I appreciate the filter design tools.

Octave is pretty good, but nowhere near as user-friendly.
 

Attachments

  • fdatool.png
    fdatool.png
    84.1 KB · Views: 451
Disabled Account
Joined 2005
I tried myself with the 1021filtN3_corr.txt. The .skr files are idendical, so no it is not that.

It looks like mkrom converts the coefficients to a little endian 32bit signed number.

A NOS filter with 8 x 1.0000 co-efficents and x1 gain generates an .skr with 8 x "00 00 00 40" co-efficents.

A filter with 8x 0.125 co-efficents and x8 gain generates an .skr with 8 x "00 00 00 40" co-efficients.

After a bit of messing around I found the threshold between 0 and 1 for x8 co-efficents:
0.0000000001164153218269 = max 0 value
0.000000000116415321827 = minimum 1 value

This translates to scaled (by gain factor) values of
9.313225746152E-10 as a maximum 0 value
9.31322574616E-10 as a minimum 1 value

The LSB increments at 0.000000000125 (1.25E-10) x8 gain or 0.000000001 (1E-09) scaled intervals.

For the x8 gain filters this means the bit transition points are roughly:

1.16415321827E-10 0->1
2.32830643654E-10 1->2
3.49245965481E-10 2->3
4.65661287308E-10 3->4
5.82076609135E-10 4->5
6.98491930962E-10 5->6
8.14907252789E-10 6->7
9.31322574616E-10 7->8

These values are the transition point between bit level values 1 and 2 in the .skr:

2.32830643653E-10 = 1
2.32830643654E-10 = 2

The above are changing value at a level of 1.0e-21, and at least one transition occurs at a level of 1.0e-22.
 
Last edited:
Disabled Account
Joined 2005
So the above appears to be the quantization of filter coefficients at LSB level.

I wonder if there is anything to be gained from dithering the coefficients to E-09 or whether this is what mkrom does behind the scenes?

and yes, both
0
and
0.0000000000
result in "00 00 00 00" in the .skr
 
Last edited:
Nobody was getting knickers moist about "keeping original samples" when they were made, so no they don't.

Attached a unity gain version of the filter with FIR1 and FIR2 set to x8.

I had a suspicion the added gain would clip but didn't have a chance to hook up to test gear. I knew someone would complain if it did. I use digital volume set around V-35 to V-25 for most listening, and can't really wind up the gain to listen if it clips at full gain. :)

I had checked previously that mkrom was smart enough to deal with straight decimals and E notation with no difference in output. I assumed that it could manage 0 or 0.0 without any problem. Nice to hear that is confirmed.

Thanks for the quick fixes Paul ;)
 
After a bit of messing around I found the threshold between 0 and 1 for x8 co-efficents:
0.0000000001164153218269 = max 0 value
0.000000000116415321827 = minimum 1 value

This translates to scaled (by gain factor) values of
9.313225746152E-10 as a maximum 0 value
9.31322574616E-10 as a minimum 1 value

That shows that Soekris is telling us the truth ;)

... The mkrom utility read and process the input .txt parameter files as 64 bit floats, including the multiplier, then convert to the 2.30/3.29 fixed formats in the final step, which are pretty good, t.ex. the SigmaDSP chips use fixed 4.24 format for coefficients....

2.30 fixed is 2^{-30}*x, x a 32-bit signed integer, so the smallest nonzero number is
2^{-30} = 9.31322574615478515625000000000E-10
and if you divide that by 8 (i.e. the smallest value if scaled up by 8) is
2^{-33} = 1.16415321826934814453125000000E-10
 
Disabled Account
Joined 2005
That shows that Soekris is telling us the truth ;)



2.30 fixed is 2^{-30}*x, x a 32-bit signed integer, so the smallest nonzero number is
2^{-30} = 9.31322574615478515625000000000E-10
and if you divide that by 8 (i.e. the smallest value if scaled up by 8) is
2^{-33} = 1.16415321826934814453125000000E-10

What we get is actually a slightly truncated version of the Truth ;)


Based on the above I did some further tests.

Lowest value* that registers as 1 is:

1.16415321826934808E-10

rather than the theoretical value of:

1.16415321826934814453125E-10


With scaling factor of 1

The lowest value* I found that would convert to 1 in the .skr file was

9.31322574615478464E-10

rather than

9.31322574615478515625000000000E-10

So a bit of rounding, and adjusting for simpler processing.

I've been working backwards from the .skr so the math coming from the other direction really helps join up the dots...

cheers
Paul

* before I got sick of "probing" with progressive high/low values.
 
Last edited:
Disabled Account
Joined 2005
Well I felt something :) with the advent of the "keeping original samples" filters so I think you should pursue this track.

Don't worry, I will ;)

I did a quick test on the DAM response today using white noise into the Konnect 8.

The response was a flat line right though the audio band to 20kHz with the NQv3UG version. There were no apparent peaks, bumps or roll off to account for the lack of high end reported in some quarters.

I've done a test with a version of the 44.1 filter quantized in the Matlab filter designer (those guys must love me, another module required for that, and another $50. bah!! We only work so we can fund our hobbies, right?)

It gives a very slightly different shape to the noise floor at the DAC outputs and minor (as in possibly 1-2dB) difference in some harmonics and peaks. Hard to spot however. I suspect there isn't too much to be gained, but there seems to be something about the MATLAB quantised filters....

Sorry about the naming btw. NQ = nyquist UG = unity gain, qnt = quantised.
 

Attachments

  • 1021filtNQv3UG_qnt.skr.zip
    2.3 KB · Views: 104
  • 1021filtNQv3UG_qnt.txt
    41.1 KB · Views: 83
Last edited: