Re: Digital sine wave generation



On Tue, 04 Apr 2006 19:37:37 -0700, The Phantom <phantom@xxxxxxx>
wrote:

On Mon, 03 Apr 2006 12:40:28 +0200, Mochuelo
<cucafera@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Ok, I know which circuit you mean. When you talk about sum-of-squares
error, you mean between the staircase and the sinusoid? If that's the
case, that is not a good criterium. You should look at the spectrum of
the staircase signal. If you have Matlab (or equivalent), you can
compute the fft of your signal and see which resistor values give you
the lowest THD, for instance.

As far as I know, minimizing sum-of-squares gives the same result as
minimizing THD.


If the minimization processis such that you can make the error as
small as you want, yes. Otherwise, not necessarily.

We are clearly in the latter case, since our delta t is fixed
(period/16) and we are choosing resistors from a set of standard
values.

In cases like this one, you may find that the set of resistors that
minimizes the THD is not the same as the set of resistors that
minimizes the sum of squared errors. Since the good criterium is
spectrum based, it doesn't make much sense wasting effort doing LSE.
LSE can provide a good starting point to be used in an iterative
algorithm that minimizes harmonic contents.

Best,

.