[sdiy] PIC-based Digital Oscillator question
Gordon JC Pearce
gordonjcp at gjcp.net
Sun Apr 24 11:19:14 CEST 2011
On Sat, 2011-04-23 at 20:03 -0400, dan snazelle wrote:
> IS DDS the same as wavetable?
>
> I didn't start hearing DDS until recently when I started using the Arduino and looking for ways to make oscillators.
>
> thanks!
Not entirely. "DDS" is "Direct Digital Synthesis" and really applies
more to RF numerically-controlled oscillators than audio.
A bit of background - radios used to use either a VFO (Variable
Frequency Oscillator) or crystals to set the operating frequency. Even
old analogue broadcast receivers use some sort of VFO, although it's a
little more "hidden" than on communications receivers.
Now VFOs have the disadvantage that the tuning is not entirely stable -
just as with analogue synthesizers, as the temperature changes the
output frequency will change and your radio will drift. Okay, so use
crystals, then. Just like the ones used for microcontrollers and the
like. Only problem there is that you can then only transmit on one
frequency (you can pull the crystal up or down a tiny bit).
Things improved greatly with synthesized tuning, using phase-locked
loops. That way, you use a VCO to generate the wanted output frequency
and you use a crystal to generate a stable reference frequency. Imagine
you have a 1MHz reference and you divide it by 1000 to get a 1kHz
output. Now, divide the VCO output by some amount (let's say 14030) and
*if it's absolutely bob on 14.030MHz* you'll also get 1kHz. If the
output of the second divider is too high, turn the VCO down until it
slips back into lock. Likewise, if it's too low, turn it up. Great.
Change that divider to 14031 and you've got a 14.031MHz output, because
the oscillator now needs to run slightly faster to keep up with the 1kHz
reference oscillator.
So with that, you've synthesized an absolutely rock solid arbitrary
frequency that doesn't drift (within the limits of the crystal) and can
be tuned in 1kHz steps. Awesome. If you want smaller steps *and* a
short lock-up time you've got some fiddling to do, because if you divide
down to 1Hz then it will take at least one second for the PLL to respond
to drift, but there are ways round that. The simple way I described is
used for channelised radios where you are tuning in (for example)
12.5kHz channel steps anyway.
And that's how we used to do it.
Direct Digital Synthesis is the "new" way to do it, which is
electronically more complex but allows fine-grained control of
frequencies. Here you use something like the phase accumulator
oscillator (I blethered on in a post about that a few weeks back, check
the archives for a really long one from me) but clocked at a
ridiculously high frequency - often in the GHz range - with a big
divider chain. At RF we tend to use the term DDS, where at AF we'd say
phase accumulator.
This guy talks about it being a DDS:
http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/
but it's really just a phase accumulator audio oscillator. And there's
not really a difference in practical terms except the sample clock.
Gordon MM0YEQ
More information about the Synth-diy
mailing list