Delta-current linear-interpolation DAC

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
rfbrw,
Think in terms of currents here. Your list of ABCD inherently assumes absolute voltage levels, which is not what its all about.

There is output A(x) on DAC1 and A(x-1) on DAC2, concurrently, always. Only 2 samples at a time. Currents are easy to substract. Result is single current that is proportional to difference between two last samples. In your example, that would be A-B, B-C, C-D, etc.
If such delta current is applied to IV Cap, exactly the waveform results that connects instants of DAC output change as if infinite linear interpolation has been done.

http://www.diyaudio.com/forums/attachment.php?s=&postid=492387&stamp=1097849833

Its a difference between blue DAC output and green delta-current output (IV-out plot). To generate such linear signal, not a single filtering stage is needed or digital filtering, only 2 DACs with delayed data on one.

The IV Cap is slew rate limiter. It must be dimensioned so that to get say 1V AC output from the DAC, slew rate on the Cap must not exceed 1V/sample for change from 0 to 64K of 16-bit sample. In essence, thats slew rate limit of 1V/22us for 44.1K audio. Thats pretty hard, but its nothing compared to 200ns settling time of DACs. And thats absolute extreme case, for lower freqeuency or lower amplitude content, slew rate on the Cap will be lower, naturally, as a result of DAC delta-current charging the Cap.
Thus, anything beyond that IV Cap is seeing slew rate limited signal to deal with.

Guido, thanks for quote. So its not new idea. I have also seen some hints on similar approach from Onkyo, but not any DIY. Why I wonder.
 
AX tech editor
Joined 2002
Paid Member
Wimms,

I like your idea, but I don't understand why the second delayed signal is necessary. One the one hand, once you know how to do the integrating, a 'normal' DAC output step into an integrator will give exactly the result you want. On the other hand, using the delayed signal, IIUC, you take the difference of two steps, which in itself is again a step. It's the integrating action that is the core of your idea IMHO.

Jan Didden
 
janneman said:
One the one hand, once you know how to do the integrating, a 'normal' DAC output step into an integrator will give exactly the result you want.
Hi Jan.
I thought this way at first too. Consider what happens though when your DAC outputs a whole line of more-or-less equal samples such as the flat top of a low frequency square wave. Feed this straight into an integrator and it will ramp up *continually* for the duration of that flat top at a rate depending on the voltage coming out of the DAC at that moment.

With the difference-of-2-DACs setup, the difference (i.e. the variation) between subsequent samples of the flat-top waveform is basically zero so the integrator gets fed zero volts and therefore holds it's output at a constant voltage, a.k.a. flat-top waveform.

Try my software in an earlier post and see!
 
Two points that concern me with the original idea:

1. You are basically differentiating (in the discrete domain) and then re-integrating (in the continuous domain) the signal. As the original poster's Point 3 suggested, this will inevitably lead to D.C. drift.

2. What advantage could this have over oversampling with a low-pass digital filter acting as an interpolator? Whereas the "traditional" oversampling filter method leads to a flat frequency/phase-response, this linear interpolation idea does not, and in fact introduces non-linearities from a transfer-function/s-domain point of view (i.e. the transfer function will depend on the values of your consecutive samples). In this respect, it behaves worse than a non-oversampling "stair-case" DAC, which will at least have a linear transfer-function.
 
janneman,
If you integrate output of normal DAC, you won't get the same thing. You could achieve almost the same result IF before feeding normal DAC you translated PCM into delta stream computationally. It is important to integrate delta-current, not absolute currents. Then you would need to change your normal DAC IV stage to integrator. Normal alias filter would fit then beyond that.
Linear interpolation occurs only if you integrate between steady states for the whole duration of sampling interval. There are only few ways to do that, all involve "memory" of the previous sample for the duration of integration.


The remaining considerations, perhaps arguable, are related to other things, not fundamental to the idea. Of course imo.

Because outputs of both DACs change simultaneously, some nonlinearities are canceled. It's utilizing similarity of channels as a matched pair. DAC transients are heavily damped. DC drift due to nonlinearity of DACs is canceled.

Integrator is purely passive device - Capacitor. No feedback. No opamp is needed at this stage. Thus linearity of IV stage is defined purely by DAC output linearity and Capacitor properties. Nothing else.
It's the linear interpolation with only passive devices that is the core of the idea.

I don't think second DAC channel is _necessary_, single DAC would be even easier for testing with PC, but I thought that it would be pain to construct delta-PCM computationally in a standalone DAC expecting normal PCM data input. The use of 2 channels is simply a straight forward method of getting delta-current.

Settling time of normal DAC can cause voltage oscillations. In delta mode, it is converted into slew-rate variations, basically damping high frequency transients very efficiently without upsetting circuitry beyond. When going to higher DAC sampling rates, settling can take quite a large proportion of whole sample interval, thus digital interpolation has some limit in its usefulness.


WRT essentially implementing first order filter, raised by Alvaius - any type of interpolation is essentially some kind of filter. Yes, this DAC would have property of lowpass filter, but its not as simple as ordinary lowpass with some fixed cutoff frequency. I'm in trouble classifying it. Its behaviour is different with discrete-time input vs linear input signal it seems. It allows instantaneous change of slew rate (and thus signal, implying infinite bandwidth) yet strictly limits the slew rate itself. With linear input it looks like first order filter with cutoff frequency of 0. Its the interaction of fixed sampling interval (Fs) and the integrator that makes the difference. If you take output peak swing for output magnitude, then such discrete interpolation has cutoff at Fs/2. Reason why sinusoidal output has lower cutoff is caused purely by signal shape approaching triangle when approaching Fs/2. That is best avoided by digital filtering and OS.

Of course, all these are just my thoughts, not necessarily correct.

I have played with this idea simulating in LTSpice. Since posting graphs in my first message I tried to tidy up DAC emulation, but can't get it perfect. At least you can get a rough view how it is simulated, in attach. DAC part isn't precise there, so be careful when making conclusions.

I see absolutely no point to this. - rfbrw
rfbrw, how can I help you? If you integrate normal step signal, you would not get linear interpolation. What is done is done to achieve _linear_ interpolation.
 

Attachments

  • dac-dual-interpol42sw.asc.txt
    12.5 KB · Views: 100
OliFilth said:
Two points that concern me with the original idea:

1. You are basically differentiating (in the discrete domain) and then re-integrating (in the continuous domain) the signal. As the original poster's Point 3 suggested, this will inevitably lead to D.C. drift.

2. What advantage could this have over oversampling with a low-pass digital filter acting as an interpolator? Whereas the "traditional" oversampling filter method leads to a flat frequency/phase-response, this linear interpolation idea does not, and in fact introduces non-linearities from a transfer-function/s-domain point of view (i.e. the transfer function will depend on the values of your consecutive samples). In this respect, it behaves worse than a non-oversampling "stair-case" DAC, which will at least have a linear transfer-function.
OliFilth, thanks for your comments.
1. This is one reason for using 2 matched DAC channels. DC drift due to DAC nonlinearities cancels out largely. Static DC offset can be biased out. The remaining signal modulated DC drift is quite similar to that with normal DAC. But yes, this is valid concern and would need more attention, or just different thinking.

2. This is not meant as substitute for digital filtering. The main advantage, in its core, is that this way interpolated signal has less spectral content than step DAC before any analog filtering. It works best when sampling rate is at least 4 times highest band frequency, which asks for digital oversampling.

WRT to your comments to transfer function, I'm not sure you are correct in frequency-phase response, and I would love to hear you elaborate your thoughts on non-linearities in transfer function/s-domain. This is area I could use some help.

janneman,
This is not exactly the same as a single-bit DAC, which is 1-bit DSD. But it has strong similarities. It is multibit DSD that allows lower bitrate at the expense of higher DAC resolution.
 
Wimms, I assumed you were proposing your method as an alternative to digital oversampling/interpolation. Now I understand that you intend to implement it in addition to oversampling, in which case my point regarding flat frequency/phase-response is no longer valid.

However, with regards to transfer-function, from the maths I've worked out, I still believe that this will give a non-linear transfer-function (I apologise in advance for the amount of maths below, but I can't think of any other way of demonstrating this):

If you consider each sample in isolation as a weighted impulse function (see Fig. 1):
f(t) = A0δ(t)
with a Laplace transform (s-domain representation):
F(s) = A0.

An externally hosted image should be here but it was not working when we last tested it.

Fig. 1: Individual sample

Using a stair-case DAC, this impulse is reproduced in the analogue world as a pulse (see Fig. 2), which can be represented as:
g(t) = A0[u(t) - u(t - T)]
where T is the sampling period, and u(t) is the unit-step function.
This has a Laplace transform of:
G(s) = A0[1 - exp(-sT)]/s.

An externally hosted image should be here but it was not working when we last tested it.

Fig. 2: Staircase DAC pulse

The transfer function of this arrangement H(s) is given by:
H(s) = G(s)/F(s)
Substituting:
H(s) = ( A0[1 - exp(-sT)]/s ) / ( A0 )
Here, the amplitude cancels, leaving a transfer-function dependent only on s (think of this as frequency):
H(s) = [1 - exp(-sT)]/s
This implies that a basic "staircase" DAC has a linear transfer-function.

Considering your proposed method:

An externally hosted image should be here but it was not working when we last tested it.

Fig. 3: Linear interpolation waveform

The individual pulse has a waveform (see Fig. 3) given as:
g(t) = [(A1 - A0)t/T + A0][u(t) - u(t - T)]
with a Laplace transform of:
G(s) = [(A1 - A0)/(T . s^2) + A0/s][1 - exp(-sT)]

When the transfer function is considered now, we get:
H(s) = ([(A1 - A0)/(T . s^2) + A0/s][1 - exp(-sT)] ) / ( A0 )
This cannot be cancelled down to a function in s only, because we have both A0 and A1 in the expression. This shows that the transfer-function is now dependent on the input values.

Please bear in mind this is something I worked out without checking anywhere to see whether this is right, so please don't take this as gospel.
 
wimms said:
rfbrw, how can I help you? If you integrate normal step signal, you would not get linear interpolation. What is done is done to achieve _linear_ interpolation.

Either I don't what you are trying to achieve or I do and don't see the point. From the simulation the net effect looks like linear interpolation and one can achieve that without all the brouhaha that seems to attend your method. If that is the case I see no point. If you are trying to do something else, I simply don't see it.
 
AX tech editor
Joined 2002
Paid Member
wimms said:
janneman,
If you integrate output of normal DAC, you won't get the same thing. You could achieve almost the same result IF before feeding normal DAC you translated PCM into delta stream computationally. It is important to integrate delta-current, not absolute currents. Then you would need to change your normal DAC IV stage to integrator. [snip]


But a 'normal' I/V IS an integrator, so I don't see how you can improve on that with what is essentially a scaling change. I thing rfbrw's comments is along the same lines, IIUC.

Jan Didden
 
dont wanna mingle into the discussion if this works or not (although HK seems to have sold something like this in the past):D

suppose it does;

The easiest way to get two matched dacs seems to me to take a stereo dac and feed it with left and left delayed and another one and feed it with right and right delayed.

... just like the one i got, however the tda1541 has an offset current which needs to be compensated. dunno if i can compensate completely, think not. Guess that would be a problem (?)
 
rfbrw said:
From the simulation the net effect looks like linear interpolation and one can achieve that without all the brouhaha that seems to attend your method.
Brouhaha? rfbrw, this is a discussion forum, so if you have constructive input, give it. I had an idea that I presented with my personal thoughts. If that is brouhaha in your book, then I suspect you're into personalities here.
As there have been noted that this is not a new idea, I don't claim its mine. So free yourself from urge to attach it to me and analyze it like idea first implemented by names like HK.
I'm genuinely interested in discussing merits or problems with that idea, and OliFilth is at least trying to make his point.

janneman said:
But a 'normal' I/V IS an integrator, so I don't see how you can improve on that with what is essentially a scaling change. I thing rfbrw's comments is along the same lines, IIUC.
Perhaps this picture below illustrates it better. There you see DAC output that corresponds to 1KHz sine sampled at 50KHz, simple RC integration of the DAC output, and delta dac output.
RC output is what the output integration of a normal DAC gives. This picture is of course exagerated, as its just simple RC, more sophisticated brickwall filters will increasingly achieve sinusoidal output, but there will always remain the character of this RC integration, which is result of memoryless integration.

Notice that the positive and negative slopes are not symmetric with RC integration. Notice larger difference (error) between original waveform and RC integration vs linear interpolation. This is manifesting as higher spectral composition of DAC output that is subsequently harder to filter, meaning higher order filter is required, is facing more difficult transients.

So, what this linear interpolation gives, is lower spectral density, higher symmetry, simpler filtering. Whether thats good thing to the sound, I don't really know, but I'm inclined to think so.
 

Attachments

  • dac-rc.gif
    dac-rc.gif
    8.4 KB · Views: 364
OliFilth said:
Considering your proposed method:

An externally hosted image should be here but it was not working when we last tested it.

Fig. 3: Linear interpolation waveform

The individual pulse has a waveform (see Fig. 3) given as:
g(t) = [(A1 - A0)t/T + A0][u(t) - u(t - T)]
with a Laplace transform of:
G(s) = [(A1 - A0)/(T . s^2) + A0/s][1 - exp(-sT)]

When the transfer function is considered now, we get:
H(s) = ([(A1 - A0)/(T . s^2) + A0/s][1 - exp(-sT)] ) / ( A0 )
This cannot be cancelled down to a function in s only, because we have both A0 and A1 in the expression. This shows that the transfer-function is now dependent on the input values.

Please bear in mind this is something I worked out without checking anywhere to see whether this is right, so please don't take this as gospel.
OliFilth,
Thanks for your input. I'd need some more time to chew your math, but here are few thoughts I had immediately.
In essence, you take chunk of signal with linear increase between time points and show that it cannot have linear transfer function. I have problem with that, because the signal could have been part of sinusoid. In effect it appears that you try to proove that analog circuit cannot have linear transfer function, because you'd have both A0 and A1 that do not cancel out and that transfer function depends on previous signal.
Also you do not compare equal things. For delta function, you take 2 samples for analysis, but for step dac only single sample.
Note that transfer function (impulse response) of delta dac is triangle around time=0, timeshifted wrt to the input. And its worth noting that ideal step is inherently nonlinear.

I suspect that you might apply wrong math to the problem. Let me try put it that way: any continuous signal can be decomposed into continuous delta function dA/dt where delta-t (dt) is approaching zero. Thats the essence of continuous signals, and with delta dac we are dealing with continuous signal, thus we should apply math of continuous signal processing. The special case here is that our dt is fixed to a discrete constant, leaving us with the only issue that dA has linear relationship through the system.

Yes, of course next output depends on previous input, but that does not necessarily mean that the transfer function is nonlinear, or that the function itself depends on previous data.

I'm not sure how to express that, I'm not too good with math, but you might want to take a look at this: http://www.spectrumsdi.com/ch13.pdf which explains the convolution integral. That is what the delta dac with integrator is basically doing.

Or here: http://cnx.rice.edu/content/m10085/latest/

But all that goes too deep into the math. I think its much simpler to grasp intuitively. Samples in PCM data describe only infinitesimal instants in time. It describes nothing that happens between the samples. The step output of a normal DAC is also form of interpolation, that is taken to be "hold" for the sake of simplicity and gain considerations. If taken from the view of continuous signal, the only correct way to reconstruct the PCM data into analog IS linear interpolation. Its just not what we assume the original waveform was. We have that strong assumption that PCM data has strictly bandwidth limited sinusoidal signal in it, that gives us the very freedom to apply filtering to reconstruct the original.

So, the comparison problem comes down to finding which DAC output after alias filtering would represent signal closest to original waveform. It can be shown that step DAC with perfect filter can reconstruct original (assuming strict bandwidth limits) exactly, but that has little practical benefit, as ideal analog brickwall filters are impossible to make. To deal with that digital filtering and OS is efficient way, but that pushes DACs to their linearity limits.

The linear analog interpolation, together with moderate OS and digital filtering, can have potential to combine best from both approaches. In addition to theoretical considerations, I'm really also looking at the practical issues, like DAC performance limitations, opamp overloads or just generally nonlinearities triggered by the step output.

guido, I don't see why you couldn't compensate the offset current.
 
Green Curve

wimms said:
Brouhaha? rfbrw, this is a discussion forum, so if you have constructive input, give it. I had an idea that I presented with my personal thoughts. If that is brouhaha in your book, then I suspect you're into personalities here.
As there have been noted that this is not a new idea, I don't claim its mine. So free yourself from urge to attach it to me and analyze it like idea first implemented by names like HK.
I'm genuinely interested in discussing merits or problems with that idea, and OliFilth is at least trying to make his point.


Perhaps this picture below illustrates it better. There you see DAC output that corresponds to 1KHz sine sampled at 50KHz, simple RC integration of the DAC output, and delta dac output.
RC output is what the output integration of a normal DAC gives. This picture is of course exagerated, as its just simple RC, more sophisticated brickwall filters will increasingly achieve sinusoidal output, but there will always remain the character of this RC integration, which is result of memoryless integration.

Notice that the positive and negative slopes are not symmetric with RC integration. Notice larger difference (error) between original waveform and RC integration vs linear interpolation. This is manifesting as higher spectral composition of DAC output that is subsequently harder to filter, meaning higher order filter is required, is facing more difficult transients.

So, what this linear interpolation gives, is lower spectral density, higher symmetry, simpler filtering. Whether thats good thing to the sound, I don't really know, but I'm inclined to think so.


Hi wimms,
Interesting picture as the signal in my DAC after the IV looks exactly like the green curve. To get a smooth signal additional filtering is required.:cool:
 
Originally posted by wimms
Brouhaha? rfbrw, this is a discussion forum, so if you have constructive input, give it. I had an idea that I presented with my personal thoughts. If that is brouhaha in your book, then I suspect you're into personalities here.

Suspect what what you want but it is now pretty clear me that you have a solution in search of a problem and if that upsets you boo hoo. Whatever it is you have thought up it is not linear interpolation as I, my text books and a number of digital audio companies know it.
 
Re: Schematics

rfbrw said:
Whatever it is you have thought up it is not linear interpolation as I, my text books and a number of digital audio companies know it.
I would suggest you to restrict your assertion to yourself alone. Anyway, it is clear that there is no hope to get any useful input from you. Sad you've wasted time in vain.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.