DSPRelated.com
Forums

Delta-Sigma Modulator Loop Filter analytical equation not useful?

Started by Vincent Ma December 9, 2004
Dear friends,

I am encountering a confusion in Delta-Sigma Modulator. Most of the
references use a linearized model to model the DSM, and an analytical
transfer function can be derived. Refer to Shenoi's "Digital Signal
Processing in Telecommunications", page 492, the denomenator of the
transfer function for a second loop DSM is derived like z^2-z+alpha,
where alpha is a parameter (alpha times the output fed back to the
input of first loop) to control the poles. Shenoi showed with a=1/2,
the loop will be stable. I wrote a simple Matlab code (as below) it
generated good result with a sin wave, Everthing is fine up to here.

But when I put a real one-bit quantizer to it (output +-1), it
generated a bad result with sin wave amplitude of 1, I then put a
scaling factor in the quantizer (output +-k) or I scale down the input
sin wave amplitude, it becomes better. (It seems that scaling up
quatizer output level generates same effect as scaling down the input
level).

Many references said simulations need to be done to verify the design,
but some references also said that the lineraized model generated
satisfactory results for loop order <= 2 . I am confused. Any
help/explanation will be highly appreciated.



----- Matlab code -----

Len = 1024*16;
m = 1:Len;

A   =   .5;
F   = 500;
Fs  = 8000;
Oversampling_Rate = 128;

In = A*cos(2*pi*F/(Fs*Oversampling_Rate)*(m-1));

alpha = .5
k     = 4

y1(1) = 0;
y2(1) = 0;
for n = 2:Len-1

% ---- This is real one-bit quantizer

    if (y2(n-1) >= 0) v(n) = +k;
    else              v(n) = -k;
    end

% ---- This is linearized model
%    v(n)  = y2(n-1);              


    e1(n) = In(n)  -alpha*v(n);
    e2(n) = y1(n-1)-      v(n);

    y1(n) = y1(n-1)+e1(n);
    y2(n) = y2(n-1)+e2(n);
end


plot(20*log10(abs(fft(v))))
Vincent Ma wrote:
> Dear friends, > > I am encountering a confusion in Delta-Sigma Modulator. Most of the > references use a linearized model to model the DSM, and an analytical > transfer function can be derived. Refer to Shenoi's "Digital Signal > Processing in Telecommunications", page 492, the denomenator of the > transfer function for a second loop DSM is derived like z^2-z+alpha, > where alpha is a parameter (alpha times the output fed back to the > input of first loop) to control the poles. Shenoi showed with a=1/2, > the loop will be stable. I wrote a simple Matlab code (as below) it > generated good result with a sin wave, Everthing is fine up to here. > > But when I put a real one-bit quantizer to it (output +-1), it > generated a bad result with sin wave amplitude of 1, I then put a > scaling factor in the quantizer (output +-k) or I scale down the input > sin wave amplitude, it becomes better. (It seems that scaling up > quatizer output level generates same effect as scaling down the input > level). > > Many references said simulations need to be done to verify the design, > but some references also said that the lineraized model generated > satisfactory results for loop order <= 2 . I am confused. Any > help/explanation will be highly appreciated. >
I can give you some explanation, but I haven't had enough time to really wrap my brain around 2nd-order modulators or get satisfactory results, in spite of having published an article on making quick & dirty 1st-order ones: http://www.wescottdesign.com/articles/sigmadelta.html. Here's what I _can_ tell you: The quantizer is a severe nonlinearity, so results from linear systems theory will be indicative, but won't tell you "the real story". The instantaneous gain of the quantizer is either zero or infinite; this means that your loop will always oscillate (this is what you want after all). So I agree with your sources that say using the linearized model won't get you where you want to go. What results are you seeing, that are troubling you? The effect where the behavior of the system depends on the ratio of the input to the quantizer value makes perfect sense, if you think about it. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
in article d4240f26.0412090245.52789a29@posting.google.com, Vincent Ma at
vinma55@hotmail.com wrote on 12/09/2004 05:45:

> But when I put a real one-bit quantizer to it (output +-1), it > generated a bad result with sin wave amplitude of 1, I then put a > scaling factor in the quantizer (output +-k) or I scale down the input > sin wave amplitude, it becomes better. (It seems that scaling up > quatizer output level generates same effect as scaling down the input > level).
the "gain of the comparator" issue is something that i harped about multiple times when i saw papers that simply replaced the comparator with an additive noise source of gain 1. why choose 1 for the gain? for a multibit quantizer, this is not an issue but it is for sigma-delta (or vise versa). i haven't been able to understand your MATLAB code. i do not understand how the input to the comparator, ostensibly y2() is defined even after simplifying it. anyway your linear model, v(n) = y2(n-1), seems to be goofy for two reasons. it doesn't have any gain parameter and there is no additive error term. anyway, if you model in some gain to the linearized comparator, you might find some explanation to why scaling the output makes it behave more like the real comparator. alpha = .5 k = 4 y1(1) = 0; y2(1) = 0; for n = 2:Len-1 % ---- This is real one-bit quantizer if (y2(n-1) >= 0) v(n) = +k; else v(n) = -k; end % ---- This is linearized model % v(n) = y2(n-1); y1(n) = y1(n-1) + In(n) - alpha*v(n); y2(n) = y2(n-1) + y(n-1) - v(n); end in any linearized model of a noise shaping feedback system, the loop gain is a quantitative parameter that affects the performance and behavior of the system. (you need to look at this with a mono-spaced font.) &#4294967295; x ---->(+)---->[H(s)]---->[Quantizer]----.---> y = quantized value &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; ^ &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;| &#4294967295; &#4294967295; &#4294967295;&#4294967295; &#4294967295; &#4294967295; | &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;| &#4294967295; &#4294967295; &#4294967295; &#4294967295; '------[-1]<---------------------' "linearized" model: &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;.---- q = quantization error &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;| &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;&#4294967295; &#4294967295;v &#4294967295; x ---->(+)---->[H(s)]---->[G]---->(+)----.---> y &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; ^ &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;| &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; | &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;| &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; '------[-1]<---------------------' "G" is the gain inherent to the quantizer. the gain from q to the output y is: &#4294967295; &#4294967295; &#4294967295; &#4294967295;&#4294967295;Y(s)/Q(s) = 1/(1 + G*H(s)) now it would appear at first that you could easily decrease the gain from the quantization to the output to an arbitrarily low amount by just increasing H (or G) to be arbitrarily large. but, of course, it can't be that easy. in a multibit quantizer noise-shaped system, the value of "G", the quantizer gain, is essentially the mean slope of the staircase function of the quantizer (or the slope of the plank that you would lay diagonally on top of the staircase). you can increase the coefficients in H(s) but then the input to the quantizer gets larger and you push it into saturation (thus limiting how much constant gain you want to put into H(s)). and once |H| is made large enough to put the quantizer into saturation, you could double or triple |H| or scale it up by 100 and it wouldn't make any difference (other than fry some transistors). it still simply remains in saturation. for the one-bit quantizer, y is either +delta/2 or -delta/2 (you had +k or -k) and there is no slope that can be inferred by the quantizer staircase function because there is no staircase function. there is only one step and you can lay a plank on it and one position and slope is just as plausible as any other position and slope. it turns out that the gain of that quantizer (G) is determined from the statistics of the input to it (i think it's the delta/2 times the mean abs value of the input divided by the variance of the input). i worked this out in about 1990 and showed it to Bob Adams only to find out later that John Paulos published a similar result in 1986 or 87. what that means is that you can crank up the gain in H(s) to whatever you want and, as long as the polarity of the gain does not change, the behavior of the quantizer remains unchanged. (this should be obvious since the quantizer is a comparator. changing the level, but not the polarity, of the input to a comparator does not affect its operation.) so in same manner of the multibit quantizer in saturation, changing the preceding gain to a one-bit quantizer does not affect the operation of the quantizer. why would that not be considered to be "saturated"? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
vinma55@hotmail.com (Vincent Ma) writes:

> Dear friends, > > I am encountering a confusion in Delta-Sigma Modulator. Most of the > references use a linearized model to model the DSM, and an analytical > transfer function can be derived. Refer to Shenoi's "Digital Signal > Processing in Telecommunications", page 492, the denomenator of the > transfer function for a second loop DSM is derived like z^2-z+alpha, > where alpha is a parameter (alpha times the output fed back to the > input of first loop) to control the poles. Shenoi showed with a=1/2, > the loop will be stable. I wrote a simple Matlab code (as below) it > generated good result with a sin wave, Everthing is fine up to here. > > But when I put a real one-bit quantizer to it (output +-1), it > generated a bad result with sin wave amplitude of 1, I then put a > scaling factor in the quantizer (output +-k) or I scale down the input > sin wave amplitude, it becomes better. (It seems that scaling up > quatizer output level generates same effect as scaling down the input > level). > > Many references said simulations need to be done to verify the design, > but some references also said that the lineraized model generated > satisfactory results for loop order <= 2 . I am confused. Any > help/explanation will be highly appreciated.
Vincent, I have no idea why you're mucking with this "linear" model. The whole point of a modulator is to reduce bit size, and the linear model doesn't. In any case, I tried your Matlab code and I get a fine looking sine wave whether k = 1 or k = 4. To plot it, I did the following: y = decimate(v, 128); plot(y); What makes you say "it generated a bad result"? --Randy
> > > > ----- Matlab code ----- > > Len = 1024*16; > m = 1:Len; > > A = .5; > F = 500; > Fs = 8000; > Oversampling_Rate = 128; > > In = A*cos(2*pi*F/(Fs*Oversampling_Rate)*(m-1)); > > alpha = .5 > k = 4 > > y1(1) = 0; > y2(1) = 0; > for n = 2:Len-1 > > % ---- This is real one-bit quantizer > > if (y2(n-1) >= 0) v(n) = +k; > else v(n) = -k; > end > > % ---- This is linearized model > % v(n) = y2(n-1); > > > e1(n) = In(n) -alpha*v(n); > e2(n) = y1(n-1)- v(n); > > y1(n) = y1(n-1)+e1(n); > y2(n) = y2(n-1)+e2(n); > end > > > plot(20*log10(abs(fft(v))))
-- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Vincent Ma wrote:
> Dear friends, > > I am encountering a confusion in Delta-Sigma Modulator. Most of the > references use a linearized model to model the DSM, and an analytical > transfer function can be derived. Refer to Shenoi's "Digital Signal > Processing in Telecommunications", page 492, the denomenator of the > transfer function for a second loop DSM is derived like z^2-z+alpha, > where alpha is a parameter (alpha times the output fed back to the > input of first loop) to control the poles. Shenoi showed with a=1/2, > the loop will be stable. I wrote a simple Matlab code (as below) it > generated good result with a sin wave, Everthing is fine up to here. > > But when I put a real one-bit quantizer to it (output +-1), it > generated a bad result with sin wave amplitude of 1, I then put a > scaling factor in the quantizer (output +-k) or I scale down the input > sin wave amplitude, it becomes better. (It seems that scaling up > quatizer output level generates same effect as scaling down the input > level). > > Many references said simulations need to be done to verify the design, > but some references also said that the lineraized model generated > satisfactory results for loop order <= 2 . I am confused. Any > help/explanation will be highly appreciated. >
snip It's been a quite a while since I've worked with DSMs but think it's something like this: If you take the noise tranfer function from the linear model the gain is 1 for small inputs going towards 0 at saturation thus for second order the poles stay inside the unit circle for all inputs, but at seturation its at the unit circle. So for quantizer output of +/-1 and a sine with amplitude 1 as input you are at the edge of unstable. afair first and second order should unconditionally stable at less than fullscale input. -Lasse
vinma55@hotmail.com (Vincent Ma) writes:
> [...]
Vincent, Let me add that I have noted that your modulator structure is a bit off, but it probably isn't going to make a big difference. Here's where: e2(n) = y1(n-1) - v(n); This forms one of the integrators with the delay in-line with the feed-forward path, which in turn screws up your signal transfer function slightly. Replace this line with the following to fix it: e2(n) = y1(n) - v(n); The test I performed which I commented on previously was using your original modulator. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Lasse Langwadt Christensen <langwadt@ieee.org> writes:

> Vincent Ma wrote: > > Dear friends, > > I am encountering a confusion in Delta-Sigma Modulator. Most of the > > > references use a linearized model to model the DSM, and an analytical > > transfer function can be derived. Refer to Shenoi's "Digital Signal > > Processing in Telecommunications", page 492, the denomenator of the > > transfer function for a second loop DSM is derived like z^2-z+alpha, > > where alpha is a parameter (alpha times the output fed back to the > > input of first loop) to control the poles. Shenoi showed with a=1/2, > > the loop will be stable. I wrote a simple Matlab code (as below) it > > generated good result with a sin wave, Everthing is fine up to here. > > But when I put a real one-bit quantizer to it (output +-1), it > > > generated a bad result with sin wave amplitude of 1, I then put a > > scaling factor in the quantizer (output +-k) or I scale down the input > > sin wave amplitude, it becomes better. (It seems that scaling up > > quatizer output level generates same effect as scaling down the input > > level). > > Many references said simulations need to be done to verify the > > design, > > > but some references also said that the lineraized model generated > > satisfactory results for loop order <= 2 . I am confused. Any > > help/explanation will be highly appreciated. > > > > snip > > It's been a quite a while since I've worked with DSMs but think it's something > like this: > > If you take the noise tranfer function from the linear model the gain is > 1 for small inputs going towards 0 at saturation > thus for second order the poles stay inside the unit circle for all inputs, > but at seturation its at the unit circle. > > So for quantizer output of +/-1 and a sine with amplitude 1 as input you are > at the edge of unstable. > > afair first and second order should unconditionally stable at less than fullscale > input.
Lasse, Can you please explain better? The plain-old, integrator-based second-order modulator I've analyzed has NO poles in its NTF, which is simply (1 - z^{-1})^2. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Dear DSP friends,


Thanks for the reply. Some of the answers are below

1. I already have a working design (got it from somewhere else and not
done by us) which uses alpha = 0.5 and k = 4. And I translate that
design into Matlab code to test. I also want to get some solid theory
to back it up too, so that is why I studied many references trying to
comfort myself that the design indeed will work.

2. I know that the quantizer is highly non-linear so the linearized
model is only a rough means trying to get SOME idea. I am pretty OK
with that. What makes me wonder is why many references said the
linearized model work pretty good for loop order <= 2, which is not
what I oberserved. So the question is that if I want to change the
coeeficeints of the loop, what do I do? Starting from the linearized
model and get one set of coefficients then run extensive simulations to
fine tune? I know for higher order loop people do that (and that is
many references said too), but for 2nd-order loop we still need to do
that?


3. For the linearized model in my Matlab code, I just want to test the
loop response, so I took the quantization noise away. Sure a white
noise can be put there, and you can see noise being shaped with both k
= 1 and k = 4.

3. What I said "bad" is (with the real one-bit quantizer) that if you
look at the FFT result of the output v, for k = 1, the spectrum looks
bad, no noise shaping at all, but with k = 4 a noise shaping is
apparent. And I also try to decode (integrate & decimate) the bit
stream, same conclusion.

4. Lesse, your explanantion is very intereting and is quite the same as
what I observed, do you have any other references for that?
Thanks, friends.

in article 1102648467.866541.285820@f14g2000cwb.googlegroups.com,
vinma55@hotmail.com at vinma55@hotmail.com wrote on 12/09/2004 22:14:

> 3. What I said "bad" is (with the real one-bit quantizer) that if you > look at the FFT result of the output v, for k = 1, the spectrum looks > bad, no noise shaping at all, but with k = 4 a noise shaping is > apparent. And I also try to decode (integrate & decimate) the bit > stream, same conclusion.
if, instead of increasing "k" by a factor of 4, what would happen if you left k equal to 1 and *decreased* "A" by a factor of 4. i would expect an identical noise-shaping behavior. it's all relative (as long as there is no polarity reversal) and the only amplitude that "k" can be measured against is "A". try to leave "k" constant and investigate the difference that you get with different input levels. now imagine what the amplitude of the signal applied to your comparator is when the input amplitude is decreased. if the input amplitude is decreased, so must also the amplitude of the signal applied to the comparator. but then the inherent gain of the comparator (in the linearized model) happens to be increased by the same amount to make up for the decrease in level. that increases the loop gain and causes more noise to be steered to the higher frequencies. think about that a little. r b-j
Robert,

You are correct, fixing k while lowering the input amplitude seems
similar to fixing input amplitude but scaling up k. They seem to
generate similar result but I don't have quantitative comparison about
the noise performance.