Re: DDS question: why sine lookup?

Liste des GroupesRevenir à c dsp 
Sujet : Re: DDS question: why sine lookup?
De : pcdhSpamMeSenseless (at) *nospam* electrooptical.net (Phil Hobbs)
Groupes : sci.electronics.design comp.dsp
Date : 07. May 2025, 16:31:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <f4d599d4-0b43-3bb7-7303-335f85629c3c@electrooptical.net>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0
On 2025-05-07 09:55, john larkin wrote:
On Tue, 6 May 2025 16:46:16 -0400, Phil Hobbs
<pcdhSpamMeSenseless@electrooptical.net> wrote:
 
On 2025-05-06 15:00, Jeroen Belleman wrote:
On 5/6/25 17:48, john larkin 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. [...]
>
Two things are immediately obvious: First, the sawtooth will have
a variable frequency, and the filter won't have a zero response
for all possible frequencies.
>
Second, the usual reconstruction filters do *not* interpolate
into straight lines.
>
Beyond that, I would have to think this over a bit more.
>
Jeroen Belleman
>
>
>
>
You don't want to use a sawtooth if you can help it, because it has huge
contributions from all harmonic orders.  It also puts a lot of demands
on the slew rate and settling of the DAC and any amplifiers used in the
filtering.  Errors there are of course nonlinear, because once an amp is
in slew limiting, it stops responding to its inputs for a bit.
>
It also emphasizes the close-in spurs.  Say you have two N-bit DDSes
running at the same average frequency but different phases.  The DAC
samples only the M high-order bits. It happens that at time t=0 the
accumulator overflows on the same clock cycle on both.
>
This will continue to happen until one of them overflows a cycle early
because the bottom N-M bits rolled over.
>
The resulting voltage difference between them is a full-scale,
one-clock-wide pulse, followed by a noisy baseline as the bottom N-M
bits roll over into the DAC's LSB at different times.  This will repeat
every cycle until the other DDS catches up.  This scenario will play out
some number of times in a full period, i.e. the least common multiple of
the accumulator size and the increment in clocks.
>
The energy in that glitch is much larger than in the noisy baseline, and
its timing is variable in complicated ways.
>
A triangle would be better, and of course that could be done pretty
simply, e.g. with a flip flop controlling a bunch of XOR gates, if you
don't mind halving the frequency.
>
Once you have a lookup table, a sine is as easy as anything else, and
minimizes the demands on the DAC, filters and amplifiers.

 I'm Spicing things and what I'm seeing in the FFT of my DAC output,
with the sawtooth, is giant subharmonics at some magic frequencies.
Those contribute the most period jitter.
Right, those are the nasty ones I'm talking about.  They're smaller with a sine output, because the nasty tall spike (which contributes power quadratically) isn't there.  They're closer in and much smaller with higher resolution DACs, and go away entirely when the DAC has the full resolution of the accumulator, because what you have then is a correctly sampled sine wave.

May as well use a sine, I guess. Still, my sim tools are useful in
tweaking the detais: NCO clock rate, lookup table size, DAC bits,
filter order. I have several products in design that need DDS clocks,
so some time playing with this is worth it. And it's interesting.
 My Basic program generates a PWL file, given choices of clock rates,
bits, and waveform. I can import that to LT Spice and take over with
filtering and such. If I just output the obvious steps to the PWL
file, Spice will draw straight lines between points and it looks
awful. I want DAC steps. The fix is to output each point twice,
suitably spaced.

 My FPGA guys say that an Efinix T55 can run a 48-bit phase accumulator
at 280 MHz. Yikes. One $10 T20 could make a dozen DDS's.
You could synthesize more cow bell that way.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com

Date Sujet#  Auteur
6 May 25 * DDS question: why sine lookup?45john 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?21Martin Brown
7 May 25 i`* Re: DDS question: why sine lookup?20john larkin
8 May 25 i +* Re: DDS question: why sine lookup?18bitrex
8 May 25 i i+* Re: DDS question: why sine lookup?16john 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?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