dmlandrum

Non-linear resistor ladder DAC?
« on: September 26, 2016, 09:54:34 PM »
It's been a long time since I've been here, but I'm motivated by something fascinating.

Apparently, one of the neater tricks used to get more dynamic range out of early digital telephone systems was to use non-linear resistor ladder DACs. These would essentially cluster the voltage levels toward the lower signals thus spreading the quantization noise out more evenly through the entire volume range.

I'm sitting here thinking I'd like to play around with the idea, and that the values of the resistors in an R2R DAC (just 8 bits) can be modified to fit a mu-law or A-law curve, but every time I think about doing the math to figure it out, my mind reels and I go back to watching old game shows and eating sunflower seeds.

I'm wondering if anyone has any information they can share or point me to on the matter. I've already exhausted Google about as far as I can. The only thing I found of any use was a chapter from a book on digital systems from Analog Semi, and it still left me more confused than informed.

Thank you for your help!
Darren Landrum

Be comforted that in the face of all aridity and disillusionment
And despite the changing fortunes of time,
There is always a big future in computer maintenance.


shabtek

Re: Non-linear resistor ladder DAC?
« Reply #1 on: September 26, 2016, 10:03:53 PM »
good to see you around DL
"really fine players do not use stomp boxes or master volume, they match the amp to the room and turn it up to 11.  Stevie Ray, BB King, Albert King, Duane Allman, Dicky Betts, Louis Armstrong"
   -CJ

Re: Non-linear resistor ladder DAC?
« Reply #2 on: September 27, 2016, 01:40:27 AM »
You can use something other than the standard R-2R ladder, but there are drawbacks. The reason R-2R is such a win is that instead of having to assemble a wide range of accurate resistor values, each trimmed to meet some logarithmic current per step spec, the R-2R ladder only needs to have two values: R and 2R, and the 2R can be made of one R and another R in series. In short, all you need is to be able to make one resistor repeatably, with a value somewhat close to what you really want, maybe ±20%.

This is why PMI's DAC-08 chip of the late 70s was able to be fabricated cheaply on an ancient monolithic process and still have excellent monotonicity, despite the difficulty of implanting a precise resistor onto an IC. The ladder accuracy was not dependent on the deposition of the resistor, which determines its absolute value, but instead upon the accuracy of the lithography, which determines the resistor ratio accuracy. So, while the DAC-08's ladder might have resistors whose absolute value ranged around ±20%, their ratio accuracy was around 1 part in 1000, enough for 1/4 bit of an 8 bit DAC.

I suppose that modern lithography could make some fairly precise "special" ratios on a modern chip, so that one could implement a log current per switch code ladder, but given a resistor implantation, the values can't have too wide of a range without making some resistors really large and some really small. This would make the small resistors less accurate, and the big ones too expensive in terms of die area.

Finally, dividing up a large problem into a logarithmic problem, which is basically what an R-2R ladder does, tends to make the circuit smaller and more minimal.

So... one can still have a logarithmic switch code with an R-2R ladder, as long as you add a layer of logic to translate the logarithmic input code to the native linear code used by the actual ladder. IIRC, Analog Devices made some LogDACs in the 80s that were just that - a competent R-2R ladder (or a few of them), connected with logic to achieve a dB per step code.

To this day, monolithic R-2R ladders seem to be limited to around 12, maybe 13 bits per ladder, and if you want more bits than that, several of these ladders can be lashed together, perhaps with calibration or trimming to get the commercially available "wide" multiplying DACs. You can buy precision resistor arrays however and do your own DAC switching, and in that world, the sky's the limit for accuracy and price.

I'm not trying to poo-poo the idea of a log ladder, but in practice, it's a real pain to get that right, especially compared to a straight, linear, R-2R ladder. The expense is basically the resistors, and having to trim a huge pile of values to get a log ladder is expensive and hard to stabilize. If you spent the same money on a pile of "one value" resistors, they might actually track over temperature and time, and would be cheaper overall, despite the fact that you'd need more of them.

JohnRoberts

Re: Non-linear resistor ladder DAC?
« Reply #3 on: September 27, 2016, 11:47:12 AM »
https://en.wikipedia.org/wiki/Μ-law_algorithm

There is no free lunch and mu-law companding was good for reducing data bandwidth for early digital voice grade communication, but telephone audio was never considered Hifi.

 IIRC these were sampled at 8kHz or so, so an audio passband well less than 4 kHz (they also rolled off low bass to make it sound more natural). 

This is interesting in that it reduces LSB step size down around zero so low level audio signals don't suffer audible quantization distortion (small sine waves would literally turn into square waves with linear quantization). Of course we end up with higher distortion at high levels that is less objectionable especially for speech.

There are many such tradeoffs in audio design (like HF pre/de-emphasis for several audio mediums), while less now than in the bad old days.

JR
John Roberts
http://circularscience.com
Tune it, or don't play it...

dmlandrum

Re: Non-linear resistor ladder DAC?
« Reply #4 on: September 27, 2016, 12:03:02 PM »
@Monte:

Okay, I see where you're going with that. Basically, put in some logic to convert the numbers from linear to whatever log law I want, then run into a standard DAC. Of course, now my mind is going to the idea of doing it with discrete logic or some kind of PLD, but honestly, a microcontroller would be easiest.

@John:

Of course everything's a tradeoff. But part of the fun for me is to play around with ideas that were never meant for what I might use them for.

Really, I had just read somewhere that the DACs in the LinnDrum were 8-bit non- linear and that prompted a search. Then I decided I wanted to look further.
Darren Landrum

Be comforted that in the face of all aridity and disillusionment
And despite the changing fortunes of time,
There is always a big future in computer maintenance.

JohnRoberts

Re: Non-linear resistor ladder DAC?
« Reply #5 on: September 27, 2016, 12:35:03 PM »
In the early days of digital audio, memory and bandwidth were expensive.

mu law codecs developed for the telephone industry were available and used for some early audio stuff... One of my jobs back in the early '70s was a speech processor that shifted the pitch of speeded up tape recordings. My company used  analog BBD to perform the pitch shift, but a digital competitor used 8 but mu-law codecs for their digital path pitch shifter.

Another early digital approach (trade-off) that might be of interest is delta-modulation, a one bit digital encoding that trades improved LF resolution for less HF resolution that worked pretty well for audio that has more energy at LF. ... That said delta-mod could sound really nasty if pushed too hard at HF.

JR 
John Roberts
http://circularscience.com
Tune it, or don't play it...

dmlandrum

Re: Non-linear resistor ladder DAC?
« Reply #6 on: September 27, 2016, 01:11:17 PM »
I seem to remember Jeri Ellsworth did a video on delta modulation, which was used in early 80s digital pinball machines. She had a machine where the decoder chip had blown with no replacements to be found, so she made one from an FPGA and a few other parts. It's an interesting method, to be sure.
Darren Landrum

Be comforted that in the face of all aridity and disillusionment
And despite the changing fortunes of time,
There is always a big future in computer maintenance.

gyraf

Re: Non-linear resistor ladder DAC?
« Reply #7 on: September 28, 2016, 03:52:50 AM »
Don't underestimate delta modulation: TC's legendary 2290 delay was based on just that, and sounded better than anything available until recently..

Jakob E.
..note to self: don't let Harman run your company..

JohnRoberts

Re: Non-linear resistor ladder DAC?
« Reply #8 on: September 28, 2016, 04:32:23 AM »
Don't underestimate delta modulation: TC's legendary 2290 delay was based on just that, and sounded better than anything available until recently..

Jakob E.
Delta mod is quite  respectable if you throw enough samples at it (clock rate). Back in the day when memory was expensive delta mod delay lines would test the limits of slew overload at long delays. PCM without enough bits turns sine waves into square waves at low level. Delta mod without enough clocks turns HF sine waves into triangle waves. Different stokes.

If you think about it modern delta sigma conversion is a glorified delta mod variant...

JR 

PS: Delta mod is not as information dense as PCM... One word of PCM provides absolute level information. Delta mod depends on what came before .
John Roberts
http://circularscience.com
Tune it, or don't play it...

gyraf

Re: Non-linear resistor ladder DAC?
« Reply #9 on: September 28, 2016, 05:45:06 AM »
Delta mod is not as information dense as PCM... One word of PCM provides absolute level information. Delta mod depends on what came before .

Yup, this also it's problem: As there's no real absolute information, there's no (easy) way of interpreting the numbers, so DSP won't really work. For a long time I was dreaming about a TC reverb on this technology until their Ivar Iversen explained me that the 2290 was actually only quasi-digital..  :(

Jakob E.
..note to self: don't let Harman run your company..


joaquins

Re: Non-linear resistor ladder DAC?
« Reply #10 on: October 26, 2016, 06:10:26 PM »
  Been there, made with some processing tool, call it Matlab or something. Separate the signal in abs and sign, keep the sign, log the abs, cut down the number of bits. Then reconstruct the signal.

  With 4 or 5 bits you already have acceptable reconstruction. I took a sample of this to my mastering course and played it, of course quality wasn't great but when I said it used to be a 5 bit format opinions changed...

  While very nice exercise, as mentioned here, little practical application as there are no standard software or hardware available to work this way. It could make sense to mount something like this to get to higher resolutions conversion and then convert to work with floating point in software, but you could just mount a floating point converter, being the exponent the reference voltage and work from there. Much easier to work it for a DAC as there are hardware available to do so and you know before hand the exponent, using two DACs, exponent as a reference and the second as MDAC. There are also ADCs with a similar approach doing one 4 bit conversion and then a second in reference to the DA reference of the first conversion.

  Doing 2nd or 3rd order approaches to the true log could be a good compromise, but again, backwards compatibility ain't on your side.

  All this would make sense if we actually needed more bits than what we have, for simple task simpler converters do the trick, for heavier task we have linear converters that go deep into the noise level. With 32 bits ADCs coming in the horizon with the firsts few metrology converters in that area things are getting darker for non linear converters. I love the concept but I guess it's just not practical.

JS
If I don't know how it works, I prefer don't turn it on.