Re: DDS question: why sine lookup?

Liste des GroupesRevenir à se design 
Sujet : Re: DDS question: why sine lookup?
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : sci.electronics.design comp.dsp
Date : 14. May 2025, 00:25:56
Autres entêtes
Organisation : To protect and to server
Message-ID : <1000ke2$1no04$1@paganini.bofh.team>
References : 1
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
In sci.electronics.design john larkin <jl@glen--canyon.com> wrote:
A DDS clock generator uses an NCO (a phase accumulator) and takes some
number of MSBs, maps through a sine lookup table, drives a DAC and a
lowpass filter and finally a comparator. The DAC output gets pretty
ratty near Nyquist, and the filter smooths out and interpolates the
steps and reduces jitter.
 
But why do the sine lookup? Why not use the phase accumulator MSBs
directly and get a sawtooth, and filter that?
 
The lowpass filter looks backwards in time for a bunch of ugly samples
to average into a straight line. The older sine samples are the wrong
polarity! If the filter impulse response is basically zero over the
period of the sawtooth, and we compare near the peak, we'll average a
lot of steps and forget the big sawtooth reset.

Sine is close to optimal for high quality DDS.  The math is
as follows.  First, your DAC has some response in time
domain, but for purpose of computation one can assume that
at clock tick number n it generates delta peak centered
at nT_0 with amplitude f(nT_0/T_1) where f is function stored in
lookup table, T_0 is period of digital clock and T_1 is desired
period.  Mathematically

S(t) = \sum_n f(nT_0/T_1)\delta(t - nT_0) = \sum_n f(t/T_1)\delta(t - nT_0)

where summation is over all integer n.

Fourier transform of this is

C\sum_l \sum_m c_l \delta(\omega - 2m\pi/T_0 - 2l\pi/T_1)

where we have double summation over integer l and m, c_l is
l-th Fourier coefficient of f and C is a constant.
Sine has only 2 Fourier components, so formula simplifies to

(1/2)C\sum_m (\delta(\omega - 2m\pi/T_0 - 2\pi/T_1) +
              \delta(\omega - 2m\pi/T_0 + 2\pi/T_1))

With aggressive filtering high freqency components can be
made arbitrarily small, so after filter Fourier transform
is

(M/2)C(\delta(\omega - 2\pi/T_1) + \delta(\omega+ 2\pi/T_1)) +
   small distortion

where M represents transmitance of the filter at frequency
1/T_1.  Back in time domain signal is

M\sin(t) + small distortion

The point is that distortion, hence phase noise can be made
arbitrarily small.

What happens with different f?  When T_0/T_1 is irrational,
the sum 2m\pi/T_0 + 2l\pi/T_1 can take values arbitrarily
close to 0.  In particular, there will be combinations of
l and m such that this sum is in the interval [-\pi/T_1, \pi/T_1],
so we will get low frequency terms with wrong frequency.
Assuming fixed low pass filter such terms can not be filered
out.  How bad this is?  For sawtooth the second Fourier
coefficient has maginitude equal to half of the magnitude
of the first coefficient, so one can expect distortion
of order 50%, which looks quite bad.  Using symmetric
troangular weave, second Fourier coefficient is 0 and
third has magnitude 1/9 of magnitude of the first
coefficient, which is much better, but still limits
possible quality.


--
                              Waldek Hebisch

Date Sujet#  Auteur
6 May 25 * DDS question: why sine lookup?46john larkin
6 May 25 +* Re: DDS question: why sine lookup?9Jeroen Belleman
6 May 25 i+- Re: DDS question: why sine lookup?1john larkin
6 May 25 i`* Re: DDS question: why sine lookup?7Phil Hobbs
6 May 25 i +* Re: DDS question: why sine lookup?3john larkin
7 May 25 i i`* Re: DDS question: why sine lookup?2john larkin
7 May 25 i i `- Re: DDS question: why sine lookup?1Bill Sloman
7 May 25 i `* Re: DDS question: why sine lookup?3john larkin
7 May 25 i  `* Re: DDS question: why sine lookup?2Phil Hobbs
7 May 25 i   `- Re: DDS question: why sine lookup?1Bill Sloman
6 May 25 +* Re: DDS question: why sine lookup?3Gerhard Hoffmann
6 May 25 i+- Re: DDS question: why sine lookup?1Don
6 May 25 i`- Re: DDS question: why sine lookup?1john larkin
7 May 25 +- Re: DDS question: why sine lookup?1Bill Sloman
7 May 25 +* Re: DDS question: why sine lookup?22Martin Brown
7 May 25 i`* Re: DDS question: why sine lookup?21john larkin
8 May 25 i +* Re: DDS question: why sine lookup?19bitrex
8 May 25 i i+* Re: DDS question: why sine lookup?17john larkin
8 May 25 i ii+- Re: DDS question: why sine lookup?1Bill Sloman
8 May 25 i ii+- Re: DDS question: why sine lookup?1Joe Gwinn
8 May 25 i ii`* Re: DDS question: why sine lookup?14Phil Hobbs
8 May 25 i ii `* Re: DDS question: why sine lookup?13john larkin
8 May 25 i ii  `* Re: DDS question: why sine lookup?12john larkin
8 May 25 i ii   `* Re: DDS question: why sine lookup?11Phil Hobbs
9 May 25 i ii    +* Re: DDS question: why sine lookup?9john larkin
9 May 25 i ii    i`* Re: DDS question: why sine lookup?8piglet
9 May 25 i ii    i `* Re: DDS question: why sine lookup?7john larkin
10 May 25 i ii    i  +- Re: DDS question: why sine lookup?1Bill Sloman
10 May 25 i ii    i  `* Re: DDS question: why sine lookup?5Lasse Langwadt
11 May 25 i ii    i   +* Re: DDS question: why sine lookup?2john larkin
11 May 25 i ii    i   i`- Re: DDS question: why sine lookup?1Phil Hobbs
11 May 25 i ii    i   `* Re: DDS question: why sine lookup?2Bill Sloman
11 May 25 i ii    i    `- Re: DDS question: why sine lookup?1Lasse Langwadt
9 May 25 i ii    `- Re: DDS question: why sine lookup?1Bill Sloman
10 May 25 i i`- Re: DDS question: why sine lookup?1Lawrence D'Oliveiro
9 May 25 i `- Re: DDS question: why sine lookup?1Martin Brown
11 May 25 +- Re: DDS question: why sine lookup?1john larkin
14 May 25 `* Re: DDS question: why sine lookup?9Waldek Hebisch
14 May 25  `* Re: DDS question: why sine lookup?8Phil Hobbs
14 May 25   +- Re: DDS question: why sine lookup?1john larkin
14 May 25   `* Re: DDS question: why sine lookup?6Waldek Hebisch
14 May 25    +* Re: DDS question: why sine lookup?4john larkin
15 May 25    i`* Re: DDS question: why sine lookup?3Phil Hobbs
15 May 25    i `* Re: DDS question: why sine lookup?2john larkin
15 May 25    i  `- Re: DDS question: why sine lookup?1Phil Hobbs
15 May 25    `- Re: DDS question: why sine lookup?1Bill Sloman

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal