DDS issues...was sine generator ic solution

Jan 30, 2005 16 Replies

DDS issues???



The concept of DDS frequency synthesizers comes up frequently. I can't figure out what they're good for. I took apart the prototype hardware, so you'll have to be content with an Excel simulation. Here's a plot of a DDS simulation.



formatting link



If you looked at it on a real-time scope, you'd likely be impressed. All the points lie exactly on the sine wave, (within D/A resolution) so statistically it's a real sinewave. Averaged over time the AVERAGE frequency can be very precise.



But if you look at it on a storage scope, you can see that each cycle is different. And the difference can change dramatically for small changes in frequency. The graph shows how for some frequencies, the output is amplitude modulated at a much lower frequency. You can't take that out with a low-pass filter.



The graph is deceptive cause it linearly interpolates the points. In actuality, there's a big ole step at each point. This becomes painfully clear if you try to use a comparator to generate a square wave. Or if you try to DDS anything other than a sine wave.



Yes, if you filter it enough, you can make anything into a sinewave. And if your hardware is a few orders of magnitude faster than your ouput requirement, the filter is easier.



What am I missing that makes DDS useful in any time-domain application or wideband frequency-domain application? mike


Return address is VALID. Wanted, PCMCIA SCSI Card for HP m820 CDRW. FS 500MHz Tek DSOscilloscope TDS540 Make Offer http://nm7u.tripod.com/homepage/te.html Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121 Bunch of stuff For Sale and Wanted at the link below. http://www.geocities.com/SiliconValley/Monitor/4710/

I can't see the pic, but a raw DDS output does indeed look nasty, and gets worse as you approach Fclk/2, the Nyquist frequency. But if you run it through a lowpass filter, you get a nice sine wave with respectably low jitter. The Sampling Theorem says so, and it works.

We build an arbitrary waveform generator that includes four DDS clock sources. The crystal oscillator freq is 40 MHz, and we synthesize wavegen clocks up to 15 MHz. The DDS chip output feeds a 4-pole LC filter and a schmitt trigger gate and makes a pretty nice clock. In retrospect, we might have used a better filter, elliptical maybe, and got a bit less jitter, but it's not bad. The filters were tweaked to peak at 15 MHz to compensate for losses and sinc distortion. I posted a graph of DDS jitter vs frequency to a.b.s.e. a while back.

If the output frequency is, say 5:1 or 10:1 below the clock frequency, the filter is easy and jitter will be very low. The rub is that at very low frequencies the filter essentially disappears and you're left with the dds dac steps re-emerging, so jitter trends toward some fixed fraction of the output period, 1/10,000 maybe, depending on the number of dac bits. In that case, one can switch filters, or keep the dds output up where the filter's still effective, and divide the schmitt output digitally to get a low-jitter lf clock.

I haven't seen the lf modulation you refer to. Very close to Nyquist, you'll get your desired signal and its image flipped about Fclk/2, which would take a brickwall filter to separate.

Really, these things are great! But without a filter, they're junk.

It is interesting that the Analog Devices datasheets used to show typical filters, and now they don't. And their eval boards used to include filters, and now don't. It's almost as if they're pretending that you don't need a filter.

John

Since you're triggering at the high slew rate part of the waveform, a little amplitude modulation probably won't affect you much.

I don't know whether to describe it as a mix or as an alias. It's most observable where the sampling frequency is not quite exactly a multiple of the output frequency. Modulation depth is a function of frequency. I found it took a big chunk out of the top end I was expecting. I don't think most people would notice the problem or object until they wanted to use those frequencies in some test that counted on stable amplitude.

I've had reports that some people can't access tripod pictures. Are there other free places to stick pictures that are more generally accessible? I'm not about to expose my primary address to spam.

Does this work any better?

formatting link

mike

In

Return address is VALID. Wanted, PCMCIA SCSI Card for HP m820 CDRW. FS 500MHz Tek DSOscilloscope TDS540 Make Offer http://nm7u.tripod.com/homepage/te.html Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121 Bunch of stuff For Sale and Wanted at the link below. http://www.geocities.com/SiliconValley/Monitor/4710/

Best case is that the device the DDS is driving has no response at the spurs. For many real world applications of DDS's this happens to be true.

Many of the DDS criticisms of today sound like the digital audio/CD criticisms of the past. Heck, even the newer low-end DDS's have 14-bit resolution, not too much different than a CD's audio format, and the DDS is usually used at full amplitude, making its effective resolution better than a CD player (unless you're just playing full-amplitude test tones all day through your CD player.)

Luckily my ears lost all sensitivity above 22kHz long ago, heck I'd be lucky to get to 11kHz...

Tim.

It's not amplitude modulation; it's the presence of a summed image, which is fixable with a lowpass filter. The horrible slithering effects you see near submultiples of the clock are really an optical illusion.

Again, a lowpass filter will take what looks like hell and fix it up into a beautiful sine wave. A telephone or a CD player is exactly the same: a digitized, sampled-data telemetry link, reconstructed by a dac and a lowpass filter. A DDS is no different from playing a sine wave on a CD player.

If you stay below, say, half of Nyquist (namely Fclk/4) it doesn't take much of a filter to clean it up nicely. The highest signal frequency will be 0.25*Fclk, and the image you need to kill will be at

0.75*Fclk, three times the fundamental. As you approach the Nyquist frequency, the filter becomes impossible.

Yup, but it's kind of small. A lowpass filter will connect (actually, extrapolate) the points better than these straight lines; it will make a nice flat sine wave.

John

I'd say you're missing the modern digital mindset. Y'know ... Oh s*it!, that's analogue, it's going to be messy, it'll need some of that awkward feedback stuff and amplitude control stuff. I've only left myself 1mm^2 on the PCB, how can I be expected to get those capacitor and resistor thingies in there?. Where can I buy an expensive, crap, pre built chip solution?. Ah!, so a DDS requires a filter then?. Would that by any unlikely chance, require an inductor thing? ..., and so on and so forth .... :-) regrds john

The sample points on the sine wave are different. Each cycle is still a sine wave.

Looking at this in another way, if your sampling rate is 100kHz and the time-sampled system is generating a frequency of 49,9999 Hz, you may indeed have a problem filtering out the reflected signal of the same amplitude and at 2 Hz higher frequency at 51,001 Hz.

I went to the doc and told him "It hurts when I do this [contorting my arm around my neck]." He said "Don't do that."

A full understanding of sampled-time systems?

There's a free textbook online at

formatting link
- I'd suggest reading starting in chapter 3 starting near the bottom of page

39, "The Sampling Theorem." This sampling stuff assumes theoretically perfect brickwall analog low-pass fiters at 1/2 the sampling rate at the input of the ADC and the output of the DAC (for many purposes it's good to assume these filters are part of the ADC and DAC). If that bothers you, remember this "assume we have a theoretically perfect X" is done in other areas of engineering - for example it's often assumed that an inductor has no capacitance between the coil windings. These are acceptable approximations in some situations, and not in others. Part of engineering is knowing which is which.

I se a magazine column title coming up: "What's all this analog(ue) stuff, anyway?"

-----

formatting link

As others have already pointed out, the artefacts on your image are caused by the missing low pass filter. A lowpass filter (for obvious reasons also called a "reconstruction filter") will reconstruct the analogue values in between of the individual samples. The result is a beautiful sine.

A digital storage scope will generate an image pretty much like the one that you have simulated with a spreadsheet program. The image will be the same, no matter whether the signal was generated by a DDS with suitable filter or an analogue oscillator. The artefacts are identical to those in your picture, but they are actually generated by the sampling of the signal, not by generating it. The culprit in that case is the sampling scope, not the DDS! You can think of a digital scope as an analogue one without the front-end anti aliasing filter.

Michael

They are very good for high frequency resolution sine wave generation. They are very good for generating extremely linear frequency ramps (chirps). They are very good for exercising fine control over the phase of a sinusoid.

When filtered appropriately, they produce good sine waves with reasonably low phase noise, and relatively low (and predictable) spurs.

Not just precise, but dead on (as long as your input clock is dead on).

It's not really modulation. It is just a sampling issue. Again, if you stay away from Nyquist, these chips do a good job. Within the Nyquist region, there are spurs, but this is often tolerable. Especially if the spurs are down by 45 dB.

If you stay far away from Nyquist, the DDS's are great. If you get near Nyquist, and don't mind a serious filter, DDS's are great.

--Mac

The signal isn't modulated, the program you use doesn't interpolate the signal correctly. Dump the samples into a raw file and open it will Cooledit (which does a proper interpolation). You'll see there is nothing wrong with the signal.

Reply to nico@nctdevpuntnl (punt=.) Bedrijven en winkels vindt U op www.adresboekje.nl

Oh, one small point. The unfiltered waveform isn't dots, it's horizontal segments, since the dac is a zero-order hold, with constant output between clocks. This produces 'sinc' (sinx/x) distortion of the fundamental amplitude, resulting in a modest loss of amplitude as the sig approaches the Nyquist frequency. One can diddle the lowpass filter to compensate, if it matters.

John

Ok, I'd jumped to the conclusion that if there were very low frequency effects visible, I would be unable to remove them with a low pass filter. I aborted the thing before I got to building the filter.

Guess I shoulda done the math.

Thanks to the other poster for the book reference. My "DSP book" was written in 1965. Haven't even opened it in almost 40 years. mike

Return address is VALID. Wanted, PCMCIA SCSI Card for HP m820 CDRW. FS 500MHz Tek DSOscilloscope TDS540 Make Offer http://nm7u.tripod.com/homepage/te.html Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121 Bunch of stuff For Sale and Wanted at the link below. http://www.geocities.com/SiliconValley/Monitor/4710/

When building a general purpose sine generator, you don't have that luxury. The thing has to be well behaved to the point that you can ignore any irregularities in operation. A hole in the usable frequency range is not acceptable.

"Doc, it huts when I breathe." How understanding would you be of, "don't do that?"

Group consensus seems to be that I'll be OK if I quit bitchin' and build the filter.

Thanks, mike mike

Return address is VALID. Wanted, PCMCIA SCSI Card for HP m820 CDRW. FS 500MHz Tek DSOscilloscope TDS540 Make Offer http://nm7u.tripod.com/homepage/te.html Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121 Bunch of stuff For Sale and Wanted at the link below. http://www.geocities.com/SiliconValley/Monitor/4710/

It's just counterintuitive. From the pix I published earlier, it looks like the samples never reach the peak value for several cycles in a row. I can't get my mind around the fact that I can fix that with a realizable/practical low pass filter. Yes, I buy that there's enough information in there to uniquely define a perfect sine wave, given enough math. Just not intuitive that it can be done with simple low pass filter with a bandwidth that's 3X the sine frequency and 11X the frequency of the offending artifact. It's not the first time something has been counterintuitive to me ;-)

I think I confused you on this one. The scope has a sampling rate 5 orders of magnitude faster than the sine wave I'm looking at. And the view of the DDS sine is still full of big ole steps.

mike

Return address is VALID. Wanted, PCMCIA SCSI Card for HP m820 CDRW. FS 500MHz Tek DSOscilloscope TDS540 Make Offer http://nm7u.tripod.com/homepage/te.html Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121 Bunch of stuff For Sale and Wanted at the link below. http://www.geocities.com/SiliconValley/Monitor/4710/

Someone once said (it was me, actually) that for a sufficiently intelligent life form, everything would be intuitively obvious. And since we're not, they're not.

Actually, it's sort of cool. It is intuitive that low frequencies have high point density and make nice sine waves if you just step back and squint a little. As the frequency approaches Nyquist, the plotted points look like hell, and some cycles don't seem to reach peak amplitude. But to filter the artifacts, you need a sharp cutoff lowpass filter. And if you put a step into a sharp-cutoff lpf, it rings and overshoots like hell. It's the filter ringing that automagically repairs the cycles that look too short.

This is trivial and amazing at the same time: the imperfections in the filter that you are forced to use, repair the imperfections in the sample set, so you get a perfect sine. Actually, Shannon's Sampling Theorem explains it all: there is sufficient information in the DDS lookup table entries to reconstruct perfect sine waves up to fclk/2 (except for the DAC quantization and hold effects, of course.)

John

[snip]

There are amplitude artefacts. It happens more seriously when the DDS starts skipping entries in the LUT. But at 200Hz - 2000Hz this is not likely to happen. It also varies with the frequency being generated, when it is some multiple of the clock frequency divided by the number of bits of the LUT/DAC you can see the strongest artefacts. When used for audio purposes, this can occur easier than intuitively expected. A low frequency may will contain higher frequency funny noises, and a higher frequency may contain lower audible frequencies. A strong low pass filter fixes the first problem, and a high pass filter fixes the second problem ;) But even when these funny noises are down 60db, it is pretty lousy for even the most simple audio purposes. On an oscilloscope it will look great of course.

Thanks, Frank. (remove 'q' and 'invalid' when replying by email) [snip]

A "hole" in the usable frequency range? I don't see where you get that. It's that the practical maximum is somewhat less than the theoretical maximum, depending on how impefect your reconstruction LPF is. In my 100ksps system above, the theoretical frequency output range of 0 to 50kHz isn't practical, but 0 to 45kHz is with a reasonable (probably four-pole) LPF on the output.

I once ran in a race (an ekiden, a marathon relay where six people run four miles each in succession) in which Jeff Galloway also ran, and he passed me. He's a few years older than me, but still I didn't try to keep up with him. I still finished, though.

This is Usenet. If you quit bitchin', it's not like there will be a great vacuum - someone else is sure to come along to take your place.

-----

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required