[sdiy] square to sine

David G Dixon dixon at mail.ubc.ca
Tue Oct 9 18:34:59 CEST 2012


Thanks to all for your excellent suggestions.

Veronica: Yes, 512 steps would be more than sufficient, but I'm not ready to
fall back on a digital solution just yet.

Paul: The Magic Sines look cool, but hard to do.

Tom: See below

Richie: As usual, your information is really excellent and useful.  I will
definitely check out the AD9834, although the letters "AD" usual send my
wallet into a spasm.  I need three or five sine wave generators for the
device I'm thinking about, so the solution needs to be low-cost or this
ain't gonna happen.  I'm also looking at the "ring counter pyramidal sinoid
through a filter" solution you alluded to, and this would definitely be
better than square.  In the case of a switched-capacitor filter, clocking
the filter at a multiple of the fundamental was always part of the plan.  In
this way, the filter doesn't have to "track" per se.  That, for me, is the
main attraction of this approach.

Noel and Scott: Given my requirements for FM, I'm not sure that the PLL
would work well enough.

Neil: The reason I want to start with a square is because I want to use a
frequency-to-voltage converter which will give me nearly perfect tracking
over the audio range, without HF correction.  I also want to be able to
apply fast FM to these oscillators, and I'm not sure that a quadrature
oscillator will respond fast enough, or track well enough.  In my
experience, quadrature oscillators tend to be a bit sluggish, have somewhat
poor amplitude control (unless higher-order filters are used, for which the
circuitry gets dense) and there is always a tradeoff between distortion and
stability.

My preferred solution at the moment is to drive an LM331 or NJM4151 F/V
converter with a 2164-tempco expo converter, and use another 2164 VCA at the
same gain to drive an integrator which takes the square wave output
(suitably limited) from the F/V converter as the current source.  By this
method, I should be able to generate a triangle wave with near perfect
tracking up to 100 kHz (which I don't need at all).  Any integrator slew
rate error will manifest itself as amplitude error in the triangle rather
than tracking error (because the F/V converter's frequency is controlled
separately and does not rely on the triangle reaching its apices), and I can
mitigate this somewhat by using fast opamps.  Then, I can simply put the
triangle through a standard differential amp sine shaper.  These shaped
sines will be less than 1% THD, and will be good enough provided the
triangle amplitude remains fairly constant.  So, for the price of one F/V
converter, one 2164, and a few opamps, I'm in business.  I can get Expo FM
in the normal way, and Linear FM at the reference current pin of the F/V
converter.  If I do need HF correction, I can use the spare 2164 as a second
expo converter.

This is my fall-back position, at any rate, until I can identify something
superior which doesn't break the bank.




More information about the Synth-diy mailing list