Groups | Search | Server Info | Login | Register


Groups > sci.electronics.design > #733263

Re: DDS question: why sine lookup?

Subject Re: DDS question: why sine lookup?
Newsgroups sci.electronics.design, comp.dsp
References <o3ak1k9ifikv6c1tmfnd89k6vfj4vigj37@4ax.com> <1000ke2$1no04$1@paganini.bofh.team>
From Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Message-ID <5d580159-4fe4-e9bc-9170-c009137d307b@electrooptical.net> (permalink)
Date 2025-05-13 20:22 -0400

Cross-posted to 2 groups.

Show all headers | View raw


On 2025-05-13 19:25, Waldek Hebisch wrote:
> 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.
> 
> 
Distortion and phase noise are only obliquely related.

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

Back to sci.electronics.design | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-06 08:48 -0700
  Re: DDS question: why sine lookup? Jeroen Belleman <jeroen@nospam.please> - 2025-05-06 21:00 +0200
    Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-06 12:33 -0700
    Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-06 16:46 -0400
      Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-06 15:50 -0700
        Re: DDS question: why sine lookup? Arie de Muijnck <noreply@ademu.nl> - 2025-05-07 11:44 +0200
          Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-07 06:32 -0700
            Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-08 01:58 +1000
      Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-07 06:55 -0700
        Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-07 11:31 -0400
          Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-08 02:11 +1000
  Re: DDS question: why sine lookup? Gerhard Hoffmann <dk4xp@arcor.de> - 2025-05-06 21:27 +0200
    Re: DDS question: why sine lookup? "Don" <g@crcomp.net> - 2025-05-06 20:10 +0000
    Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-06 13:35 -0700
  Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-07 16:27 +1000
  Re: DDS question: why sine lookup? Martin Brown <'''newspam'''@nonad.co.uk> - 2025-05-07 20:32 +0100
    Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-07 13:01 -0700
      Re: DDS question: why sine lookup? bitrex <user@example.net> - 2025-05-07 20:27 -0400
        Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-07 19:21 -0700
          Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-08 22:49 +1000
          Re: DDS question: why sine lookup? Joe Gwinn <joegwinn@comcast.net> - 2025-05-08 11:01 -0400
          Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-08 14:20 -0400
            Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-08 11:58 -0700
              Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-08 16:24 -0400
                Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-08 14:18 -0700
                Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-08 22:28 +0000
                Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-08 16:24 -0700
                Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-08 23:57 +0000
                Re: DDS question: why sine lookup? piglet <erichpwagner@hotmail.com> - 2025-05-09 04:48 +0000
                Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-09 12:53 -0700
                Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-10 18:53 +1000
                Re: DDS question: why sine lookup? Lasse Langwadt <llc@fonz.dk> - 2025-05-10 19:52 +0200
                Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-10 11:53 -0700
                Re: DDS question: why sine lookup? dplatt@coop.radagast.org (Dave Platt) - 2025-05-10 16:50 -0700
                Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-10 17:39 -0700
                Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-11 16:27 -0400
                Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-11 16:55 +1000
                Re: DDS question: why sine lookup? Lasse Langwadt <llc@fonz.dk> - 2025-05-11 22:03 +0200
                Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-09 15:52 +1000
        Re: DDS question: why sine lookup? Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-05-10 00:44 +0000
      Re: DDS question: why sine lookup? Martin Brown <'''newspam'''@nonad.co.uk> - 2025-05-09 09:32 +0100
  Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-10 17:00 -0700
  Re: DDS question: why sine lookup? antispam@fricas.org (Waldek Hebisch) - 2025-05-13 23:25 +0000
    Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-13 20:22 -0400
      Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-13 18:40 -0700
      Re: DDS question: why sine lookup? antispam@fricas.org (Waldek Hebisch) - 2025-05-14 15:35 +0000
        Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-14 15:05 -0400
          Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-14 14:53 -0700
            Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-14 19:16 -0400
              Re: DDS question: why sine lookup? john larkin <jl@glen--canyon.com> - 2025-05-14 17:10 -0700
                Re: DDS question: why sine lookup? Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2025-05-15 12:40 -0400
          Re: DDS question: why sine lookup? Bill Sloman <bill.sloman@ieee.org> - 2025-05-15 17:23 +1000

csiph-web