4 ms·
Numerically Controlled Oscillators
- VLM 11y agoMight get a kick out of comparing this software algo which works at Hz to KHz with DDS synthesis hardware which works at MHz to GHz. Typical example, an AD9851, low performance, but simple, cheap, and runs up thru VHF frequencies. http://www.analog.com/media/en/technical-documentation/data-sheets/AD9851.pdf http://www.analog.com/media/en/technical-documentation/data-... (start reading around page 12)
- tzs 11y agoWhat do you mean by "low performance"?
- VLM 11y agoWell, its a more than decade old DDS chip. Compare to something only five or so years old like a AD9912 from the same mfgr. Admittedly it costs more and drops about twice the power, darn near a watt. However, twice the max output frequency, 48 bit tuning word instead of 32 gives somewhat higher precision, 14 bit DAC instead of 10 bit DAC should give much better phase noise performance, a fancy ole PLL refclock input instead of a fixed six-tupler refclock input is more flexible... The "spur-killer" features of the new DDS are kinda cool, you can programmatically predict spurs, more or less, so feed in an intentional signal 180 degrees out of phase and that spur disappears from the output, cool (although it adds complication). The electrical IO capabilities of the new DDS are pretty interesting. Thats all I get in 5 minutes with both datasheets, although I'm sure if I dug in the specific phase noise details of the new chip would likely be way lower. Something instructive to look at WRT complication is the decade old chip has a single 40 bit control "word" aka you squirt 5 bytes at it and call it done. The newer chip has a multiple printed page IO register map with dozens of addresses... programming old DDS was like "undergrad lab class" level of complicated but programming newer DDS is not for faint of heart. In another decade, "one GHz-ish" maybe 64 bit tuning words, 16 bit DAC all sound "believable" for a watt and $25 or so. DDS are cool.
- aswanson 11y agoGot a kick out of reading this in the datasheet: "Both versions of the AD9851 evaluation boards are designed to interface to the parallel printer port of a PC. The operating software (C++) runs under Microsoft® Windows® (Windows 3.1 and Windows 95); Windows NT® not supported ...."
- VLM 11y agoWell, it is over a decade old. I think I need to cross it off "cheap" also as its now impacted the far side of the price bathtub curve and costs a bit more than newer competitors. At least it is a relatively simple chip.
- ChuckMcM 11y agoBack when 8 bit micros were the "big" machines :-) Hal Chamberlin wrote a book called "The Musical Applications of Digital Microprocessors" which discusses this sort of frequency synthesis in detail. Recommended if you can find a used copy somewhere.
- jcr 11y agoIt seems the title is just: "Musical Applications of Microprocessors" http://www.amazon.com/Musical-Applications-Microprocessors-Hal-Chamberlin/dp/0810457687/ http://www.amazon.com/Musical-Applications-Microprocessors-H...
- ChuckMcM 11y agoThat is the one.
- msarnoff 11y agoI second this recommendation, especially Chamberlin's discussion of filters. He provides an implementation of a state-variable filter (low-pass, high-pass, band-pass, and notch) in, if I recall correctly, four lines of BASIC. I wrote a version of it in ARM Thumb assembler for the Cortex-M0 and it sounded quite good. [1] Despite being published over 30 years ago, it's a great resource for anyone interested in sound synthesis on resource-constrained systems. [1] - https://github.com/74hc595/LPC1114-Synthesizer/blob/master/kernel.S https://github.com/74hc595/LPC1114-Synthesizer/blob/master/k...
- a1k0n 11y agoHe even has a quadrature (as in, sine and cosine) oscillator for any frequency, using only integer adds and multiplies, which would obviate the lookup table used in this post. It's a bit like masswerk's post above, except with a derivation of what to set "epsilon" to. The book has been out of print forever, and I waited months for my copy, but it was worth it...
- masswerk 11y agoRegarding quick oscillators, compare Marvin Minsky's method for circles by shifts only: «Here is an elegant way to draw almost circles on a point-plotting display: NEW X = OLD X – epsilon * OLD Y NEW Y = OLD Y + epsilon * NEW(!) X This makes a very round ellipse centered at the origin with its size determined by the initial point. epsilon determines the angular velocity of the circulating point, and slightly affects the eccentricity. If epsilon is a power of 2, then we don't even need multiplication, let alone square roots, sines, and cosines! The "circle" will be perfectly stable because the points soon become periodic. The circle algorithm was invented by mistake when I tried to save one register in a display hack! Ben Gurley had an amazing display hack using only about six or seven instructions, and it was a great wonder. But it was basically line-oriented. It occurred to me that it would be exciting to have curves, and I was trying to get a curve display hack with minimal instructions.» ("Item 149 (Minsky): Circle Algorithm" in HAKMEM, Programming Hacks. MIT AI Memo 239, Feb. 29, 1972) Remarkably, this approach was also used for sine and cosine computations in the Sinclair Scientific pocket calculator (1974): http://files.righto.com/calculator/sinclair_scientific_simulator.html http://files.righto.com/calculator/sinclair_scientific_simul... For a fun application using oscillators based on this algorithm see the "Minskytron" (by Marvin Minsky, early 1960s), http://www.masswerk.at/minskytron/ http://www.masswerk.at/minskytron/