Hi Vincent,
Let me respond to a couple of your points below.
vinma55@hotmail.com writes:
> 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'm a pessimist, Vincent. The design you obtained was implemented by
human beings just as capable as being fallable as you or I. I would
not trust for a second that something is correct just because it
came from working prototype.
Now that last statement might seem a bit strange until you realize
that "correct" means "perfectly correct." It is very possible that
a design works "ok" or "pretty good" but still has errors in it.
There is also the possibility that you translated the design incorrectly
into Matlab code.
> 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?
I think you're confused about the meaning of the term "linearized model."
This technique is a method of representing the quantizer as a
sum of the input and a quantization signal:
y[n] = x[n] + q[n],
where x[n] is the input to the quantizer and y[n] is the output.
> 3. For the linearized model in my Matlab code, I just want to test the
> loop response, so I took the quantization noise away.
Err, with no quantization noise, how can you check the loop response?
By "loop response" response I presume you mean "closed loop response",
and the quantization noise is the ONLY thing affected by the
closed-loop response in a properly-designed modulator. In other words,
the quantization noise is the only thing that is filtered in a
proper-designed modulator. So if you take it away, you can't observe
anything. (The signal should pass through with the magnitude response
unmodified.)
> Sure a white
> noise can be put there, and you can see noise being shaped with both k
> = 1 and k = 4.
Yes, that's the proper way to do it. That is, input white noise into
the quantizer, NOT into the input. Actually what is best is to dither the
input to the quantizer so that you get rid of those nasty limit cycles.
> 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.
I didn't spend time debugging your loop and analyzing it completely, but
there are a couple of things that don't look right to me about it. 1) The
update equations are in the wrong order - you should compute y1 before e2
since e2 uses the output from y1. Then you used y1(n-1) in computing e2(n).
That sort of undoes the fact that you've got the loop equations out of
order, but it also adds a delay in the loop which impacts the overall
transfer function(s) (noise and signal). I redid your loop the "right" way
and included it at the end of this post.
If you set alpha = k = 1, your original loop results in a NTF of
NTF(z) = (1 - z^{-1})^2 / (1 - z^{-1} + z^{-2})
This places a pole in the NTF that isn't normally there (normally for
an integrator-based modulator you only have zeros).
If you "fix" the loop as my code at the end and include the gain k
in the analysis, I get the following resulting NTF
NTF(z) = k*(1 - z^{-1})^2 / (1 + (k-1)*z^{-1})
When k != 1, you get a pole in the NTF. This pole will boost the
quantization noise and make it APPEAR that the noise-shaping is
working better, but it's really just boosting the noise. In fact,
I evaluated a first-order loop in-band noise for k = 1 and k = 4 and
k = 1 gets over 5 dB better:
k quantization noise power (dB)
- ------------------------
1 -55.5357
4 -59.9940
Finally, you may be getting some bogus quantization noise spectra when
you run your modulator without dither and use a highly correlated
signal such as a sine wave. I've include dither in the code below so
that the spectrum is more consistent independent of the input signal.
Finally, here's the reference I've used a lot in the past:
@BOOK{deltasigmadataconverters,
title = "Delta-Sigma Data Converters: Theory, Design, and Simulation",
author = "{Steven~R.~Norsworthy,} {Richard~Schreier,} and {Gabor~C.~Temes}",
publisher = "IEEE Press",
year = "1997"}
Hope this helps.
--Randy
function [v,y1,y2,e1,e2,q,dn] = ds(k)
A = 0;
F = 500;
Fs = 8000;
Oversampling_Rate = 128;
%Len = 1024*Oversampling_Rate;
Len = 1024*16;
%Len = 100*Oversampling_Rate;
m = 1:Len;
In = A*cos(2*pi*F/(Fs*Oversampling_Rate)*(m-1));
alpha = 1;
%k = 4;
y1 = zeros(1, Len);
y2 = zeros(1, Len);
v = zeros(1, Len);
q = zeros(1, Len);
w = zeros(1, Len);
dn = 2*k*(rand(1, Len) - 0.5);
%dn = zeros(1, Len);
for n = 2:Len-1
e1(n) = In(n) - alpha*v(n-1);
y1(n) = y1(n-1) + e1(n);
e2(n) = y1(n) - v(n-1);
y2(n) = y2(n-1) + e2(n);
w(n) = y2(n) + dn(n);
if (w(n) >= 0)
v(n) = +k;
else
v(n) = -k;
end
q(n) = In(n) - v(n);
end
figure;
psd(v);
title(sprintf('Signal Spectrum, k = %d, alpha = %d, A = %d', k, alpha, A));
figure;
psd(q);
title(sprintf('Quantization Spectrum, k = %d, alpha = %d, A = %d', k, alpha, A));
figure;
plot(decimate(v,128));
title(sprintf('Decimated Signal, k = %d, alpha = %d, A = %d', k, alpha, A));
%plot(20*log10(abs(fft(v))))
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124