time-nuts@lists.febo.com

Discussion of precise time and frequency measurement

View all threads

DDS - Cosine v. Sine LUT

K
KD0GLS
Tue, Jun 21, 2011 5:44 PM

With all the discussion lately regarding DDS and CORDIC, I'm reminded of a question that came up some time ago for which I've never found an answer.  Perhaps you enlightened people can enlighten me.

Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT?  On the surface, starting the roller coaster ride at the top of the hill (assuming the phase accumulator starts from zero) seems odd.

.73,
Brent, KD0GLS, Minneapolis

With all the discussion lately regarding DDS and CORDIC, I'm reminded of a question that came up some time ago for which I've never found an answer. Perhaps you enlightened people can enlighten me. Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT? On the surface, starting the roller coaster ride at the top of the hill (assuming the phase accumulator starts from zero) seems odd. .73, Brent, KD0GLS, Minneapolis
CA
Chris Albertson
Tue, Jun 21, 2011 6:38 PM

On Tue, Jun 21, 2011 at 10:44 AM, KD0GLS kd0gls@mninter.net wrote:

Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT?

Are the LUTs really different?  Ages ago when I made something like
this I used only 90 degrees of the table. That is all you need.  The
other 270 degrees can be made by flipping or inverting.  I assume that
what's stored is neither.  It is data that needs to be interpeted
based on the current quadrant.  But the author might choose to call it
which ever makes the most sense.

--

Chris Albertson
Redondo Beach, California

On Tue, Jun 21, 2011 at 10:44 AM, KD0GLS <kd0gls@mninter.net> wrote: > Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT? Are the LUTs really different? Ages ago when I made something like this I used only 90 degrees of the table. That is all you need. The other 270 degrees can be made by flipping or inverting. I assume that what's stored is neither. It is data that needs to be interpeted based on the current quadrant. But the author might choose to call it which ever makes the most sense. -- Chris Albertson Redondo Beach, California
K
KD0GLS
Tue, Jun 21, 2011 7:03 PM

On Jun 21, 2011, at 13:39, Chris Albertson wrote:

I used only 90 degrees of the table.

Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine?  A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice.

.73,
Brent, KD0GLS, Minneapolis

> On Jun 21, 2011, at 13:39, Chris Albertson wrote: > > I used only 90 degrees of the table. > Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine? A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice. .73, Brent, KD0GLS, Minneapolis
L
lists@lazygranch.com
Tue, Jun 21, 2011 7:11 PM

The cordic needs to compute both sin and cos. You are right that you just need one or the other if you have one DAC.

-----Original Message-----
From: Chris Albertson albertson.chris@gmail.com
Sender: time-nuts-bounces@febo.com
Date: Tue, 21 Jun 2011 11:38:30
To: Discussion of precise time and frequency measurementtime-nuts@febo.com
Reply-To: Discussion of precise time and frequency measurement
time-nuts@febo.com
Subject: Re: [time-nuts] DDS - Cosine v. Sine LUT

On Tue, Jun 21, 2011 at 10:44 AM, KD0GLS kd0gls@mninter.net wrote:

Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT?

Are the LUTs really different?  Ages ago when I made something like
this I used only 90 degrees of the table. That is all you need.  The
other 270 degrees can be made by flipping or inverting.  I assume that
what's stored is neither.  It is data that needs to be interpeted
based on the current quadrant.  But the author might choose to call it
which ever makes the most sense.

--

Chris Albertson
Redondo Beach, California


time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

The cordic needs to compute both sin and cos. You are right that you just need one or the other if you have one DAC. -----Original Message----- From: Chris Albertson <albertson.chris@gmail.com> Sender: time-nuts-bounces@febo.com Date: Tue, 21 Jun 2011 11:38:30 To: Discussion of precise time and frequency measurement<time-nuts@febo.com> Reply-To: Discussion of precise time and frequency measurement <time-nuts@febo.com> Subject: Re: [time-nuts] DDS - Cosine v. Sine LUT On Tue, Jun 21, 2011 at 10:44 AM, KD0GLS <kd0gls@mninter.net> wrote: > Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT? Are the LUTs really different? Ages ago when I made something like this I used only 90 degrees of the table. That is all you need. The other 270 degrees can be made by flipping or inverting. I assume that what's stored is neither. It is data that needs to be interpeted based on the current quadrant. But the author might choose to call it which ever makes the most sense. -- Chris Albertson Redondo Beach, California _______________________________________________ time-nuts mailing list -- time-nuts@febo.com To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
LC
Luis Cupido
Tue, Jun 21, 2011 7:18 PM

Hi Brent,

A quarter table cos is exactly the same as a quarter table sin.
Only backwards, and not telling which quarter it is makes it a
quarter of either sin or cos. For one single output becomes irrelevant
as you only need one.
So I think it is just a matter of taste the name to call it.

Luis Cupido.
ct1dmk.

On 6/21/2011 8:03 PM, KD0GLS wrote:

On Jun 21, 2011, at 13:39, Chris Albertson wrote:

I used only 90 degrees of the table.

Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine?  A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice.

.73,
Brent, KD0GLS, Minneapolis


time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Hi Brent, A quarter table cos is exactly the same as a quarter table sin. Only backwards, and not telling which quarter it is makes it a quarter of either sin or cos. For one single output becomes irrelevant as you only need one. So I think it is just a matter of taste the name to call it. Luis Cupido. ct1dmk. On 6/21/2011 8:03 PM, KD0GLS wrote: > >> On Jun 21, 2011, at 13:39, Chris Albertson wrote: >> >> I used only 90 degrees of the table. >> > > > Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine? A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice. > > .73, > Brent, KD0GLS, Minneapolis > > _______________________________________________ > time-nuts mailing list -- time-nuts@febo.com > To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts > and follow the instructions there. >
MD
Magnus Danielson
Tue, Jun 21, 2011 7:26 PM

On 06/21/2011 09:03 PM, KD0GLS wrote:

On Jun 21, 2011, at 13:39, Chris Albertson wrote:

I used only 90 degrees of the table.

Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine?  A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice.

By the way, you can save two bits of the LUT table width by only storing
the difference of the binary phase and the sine. Add the phase
(90-degree wrapped) to the output of the LUT to get the sine. In effect
the LUT can be allowed to be shifted two bits down for improved precision.

Cheers,
Magnus

On 06/21/2011 09:03 PM, KD0GLS wrote: > >> On Jun 21, 2011, at 13:39, Chris Albertson wrote: >> >> I used only 90 degrees of the table. >> > > > Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine? A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice. > By the way, you can save two bits of the LUT table width by only storing the difference of the binary phase and the sine. Add the phase (90-degree wrapped) to the output of the LUT to get the sine. In effect the LUT can be allowed to be shifted two bits down for improved precision. Cheers, Magnus
RL
Robert LaJeunesse
Tue, Jun 21, 2011 7:31 PM

Brent,

For the specific case of generating a synchronous FSK signal with a fairly wide
shift there may be a reason. Such an application presumes a high enough ratio
between clock and output frequencies such that the DDS accumulator landing
adequately near zero is a certainty. If the FSK frequency is changed
synchronously - just after the point of DDS accumulator rollover - a sine LUT
would potentially show an abrupt change in dv/dt (slew rate) with the frequency
change. By using a cosine LUT the signal would be at its peak, and dv/dt would
be virtually zero both before and after the frequency change.

Bob LaJeunesse
Ann Arbor, MI


From: KD0GLS kd0gls@mninter.net
To: Time-Nuts time-nuts@febo.com
Sent: Tue, June 21, 2011 1:44:26 PM
Subject: [time-nuts] DDS - Cosine v. Sine LUT

With all the discussion lately regarding DDS and CORDIC, I'm reminded of a
question that came up some time ago for which I've never found an answer. 
Perhaps you enlightened people can enlighten me.

Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835),
why would one device favor a cosine LUT versus a sine LUT?  On the surface,
starting the roller coaster ride at the top of the hill (assuming the phase
accumulator starts from zero) seems odd.

.73,
Brent, KD0GLS, Minneapolis


time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Brent, For the specific case of generating a synchronous FSK signal with a fairly wide shift there may be a reason. Such an application presumes a high enough ratio between clock and output frequencies such that the DDS accumulator landing adequately near zero is a certainty. If the FSK frequency is changed synchronously - just after the point of DDS accumulator rollover - a sine LUT would potentially show an abrupt change in dv/dt (slew rate) with the frequency change. By using a cosine LUT the signal would be at its peak, and dv/dt would be virtually zero both before and after the frequency change. Bob LaJeunesse Ann Arbor, MI ________________________________ From: KD0GLS <kd0gls@mninter.net> To: Time-Nuts <time-nuts@febo.com> Sent: Tue, June 21, 2011 1:44:26 PM Subject: [time-nuts] DDS - Cosine v. Sine LUT With all the discussion lately regarding DDS and CORDIC, I'm reminded of a question that came up some time ago for which I've never found an answer.  Perhaps you enlightened people can enlighten me. Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT?  On the surface, starting the roller coaster ride at the top of the hill (assuming the phase accumulator starts from zero) seems odd. .73, Brent, KD0GLS, Minneapolis _______________________________________________ time-nuts mailing list -- time-nuts@febo.com To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
K
KD0GLS
Tue, Jun 21, 2011 8:09 PM

That's an interesting thought.  The diagram of the 9835 (the one labeled as having the cosine ROM) also shows some sync logic associated with the select lines steering the FSK and PSK registers.  If that logic syncs the select lines to the phase accumulator rollover, as you said, the slope of the signal would be near zero at that point, as opposed to at the zero-crossing with a sine-based device.  An interesting theory at least.

On Jun 21, 2011, at 14:31, Robert LaJeunesse wrote:

Brent,

For the specific case of generating a synchronous FSK signal with a fairly wide shift there may be a reason. Such an application presumes a high enough ratio between clock and output frequencies such that the DDS accumulator landing adequately near zero is a certainty. If the FSK frequency is changed synchronously - just after the point of DDS accumulator rollover - a sine LUT would potentially show an abrupt change in dv/dt (slew rate) with the frequency change. By using a cosine LUT the signal would be at its peak, and dv/dt would be virtually zero both before and after the frequency change.

Bob LaJeunesse
Ann Arbor, MI

From: KD0GLS kd0gls@mninter.net
To: Time-Nuts time-nuts@febo.com
Sent: Tue, June 21, 2011 1:44:26 PM
Subject: [time-nuts] DDS - Cosine v. Sine LUT

With all the discussion lately regarding DDS and CORDIC, I'm reminded of a question that came up some time ago for which I've never found an answer.  Perhaps you enlightened people can enlighten me.

Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT?  On the surface, starting the roller coaster ride at the top of the hill (assuming the phase accumulator starts from zero) seems odd.

.73,
Brent, KD0GLS, Minneapolis


time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

.73,
Brent, KD0GLS, Minneapolis

That's an interesting thought. The diagram of the 9835 (the one labeled as having the cosine ROM) also shows some sync logic associated with the select lines steering the FSK and PSK registers. If that logic syncs the select lines to the phase accumulator rollover, as you said, the slope of the signal would be near zero at that point, as opposed to at the zero-crossing with a sine-based device. An interesting theory at least. On Jun 21, 2011, at 14:31, Robert LaJeunesse wrote: > Brent, > > For the specific case of generating a synchronous FSK signal with a fairly wide shift there may be a reason. Such an application presumes a high enough ratio between clock and output frequencies such that the DDS accumulator landing adequately near zero is a certainty. If the FSK frequency is changed synchronously - just after the point of DDS accumulator rollover - a sine LUT would potentially show an abrupt change in dv/dt (slew rate) with the frequency change. By using a cosine LUT the signal would be at its peak, and dv/dt would be virtually zero both before and after the frequency change. > > Bob LaJeunesse > Ann Arbor, MI > > From: KD0GLS <kd0gls@mninter.net> > To: Time-Nuts <time-nuts@febo.com> > Sent: Tue, June 21, 2011 1:44:26 PM > Subject: [time-nuts] DDS - Cosine v. Sine LUT > > With all the discussion lately regarding DDS and CORDIC, I'm reminded of a question that came up some time ago for which I've never found an answer. Perhaps you enlightened people can enlighten me. > > Given a complete DDS chip with a single output channel (e.g. AD9834, AD9835), why would one device favor a cosine LUT versus a sine LUT? On the surface, starting the roller coaster ride at the top of the hill (assuming the phase accumulator starts from zero) seems odd. > > .73, > Brent, KD0GLS, Minneapolis > > _______________________________________________ > time-nuts mailing list -- time-nuts@febo.com > To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts > and follow the instructions there. .73, Brent, KD0GLS, Minneapolis
GH
Gerhard Hoffmann
Tue, Jun 21, 2011 11:10 PM

Am 21.06.2011 21:03, schrieb KD0GLS:

On Jun 21, 2011, at 13:39, Chris Albertson wrote:

I used only 90 degrees of the table.

Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine?  A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice.

It can be the same table, and if it delivers sine or cosine is
determined only
whether you start indexing from the highest or lowest address .
(if you store only 1/4 wave)

When you split the ROM into 2 smaller ones, you can get sin and
cos at the same time, there will never be an address clash.
One ROM for 0...44.9 deg and one for 45...89.999° . Just a MUX
to select the appropriate ROM for each output and a little bit of
address massage.

Big cost saver for complex converters.

Gerhard, dk4xp

Am 21.06.2011 21:03, schrieb KD0GLS: >> On Jun 21, 2011, at 13:39, Chris Albertson wrote: >> >> I used only 90 degrees of the table. > Yes, as did I and most implementations, but why a cosine quarter-table instead of the more common sine? A quick look at the data sheets (and the waveforms in the theory-of-op sections) for the two devices suggests they are clearly calling out one or the other, but without rationale regarding the choice. It can be the same table, and if it delivers sine or cosine is determined only whether you start indexing from the highest or lowest address . (if you store only 1/4 wave) When you split the ROM into 2 smaller ones, you can get sin and cos at the same time, there will never be an address clash. One ROM for 0...44.9 deg and one for 45...89.999° . Just a MUX to select the appropriate ROM for each output and a little bit of address massage. Big cost saver for complex converters. Gerhard, dk4xp