You can approximate a sine wave by putting a triangle wave through a circuit that has a hyperbolic tangent shaped transfer function. The following circuit (from "Musical Applications of Microprocessors " by Hal Chamberlin)approximates that function by using the conduction characteristics of two back to back diodes at low currents:
Though I haven't tried to do it the author claims that with precision components and adjustment the circuit can be adjusted to under 1% harmonic distortion. You could do a similar thing with a differential amplifier or an OTA.
If this circuit is really published the way you drew it, it shows how little a uP guy knows about analogue. The distortion may be even higher than of the triangle wave at the input, and
As pointed out by other participants, you can obtain a sine wave from a triangle wave thanks to a nonlinear transform of the signal. The National Semiconductor application note 263 is worth reading and contains a paragraph dedicated to those techniques:
formatting link
(see "Approximation Methods" paragraph beginning at page 8)
Not in this world it doesn't. Both contain only the odd harmonics but in varying amounts. You get from square to triangle by integrating it. _ _ _ _| |_| |_| |_
A square wave is sum (-1)^(2n+1).sin((2n+1)wt)/(2n+1) n=0 .. inf
When you integrate a square wave you get a triangle wave - usually available off the timing capacitor with a bit of buffering.
/\ /\ /\ \/ \/ \/
The expression for the square wave can be integrated to give:
A triangle wave is sum sin((2n+1)wt)/(2n+1)^2 n=0 .. inf
You could take the linear combination of triangle + square/3 to null out the third harmonic but the waveform would look nothing like a sine wave because of all the other uncancelled higher harmonics.
And the zero crossing would be perpendicular which is not right.
None at all.
A much better way ISTR originally poineered by HP is to take a triangle wave and apply diode shaping to it. First order is to just clip the top off and the next order chamfers the rough edges then a low pass filter.
Neater methods by varying gain with amplitude exist too. Although the neatest of all is probably based on log shaping. Almost all of these tricks have been displaced by direct digital synthesis now.
Natsemi has an app note that reviews sine generation methods that you might find interesting:
formatting link
And venerable Intersil ICL8038 part that first embodied square, triangle and a sinewave shaper on one chip is still online at
Use no filtering and only the triangle waveform: pass thru what 40-50 years ago was called a DFG (diode function generator) at least 16 segments for each polarity; THD result can be quite low (less than 0.5% aka 46dB THD.
Yep, the circuit is exactly the way it's drawn in the book - the FET is listed as a 2N3819. When I built the circuit I think it gave me a THD of like 10%, so I was wondering what black magic the author was using to get it below 1%. Looking at it more carefully I can understand why, it's an approximation to an approximation - the curve of the hyperbolic tangent function (e^2x -1)/(e^2x + 1) which approximates a sine is itself approximated by an ordinary diode law exponential. I think the reason it was included is that it's cheap: at the time the book was published (1980) OTAs probably cost the equivalent of $10 each and if someone were assembling a "voice per board" type synthesizer with a lot of voices the cost of an OTA and assorted components to make a sine wave for each voice might become prohibitive. In a synthesizer perhaps they figure the signal is just going to be stuffed through a low pass VCF anyhow so the THD is not such a big deal.
I like the idea of using a Taylor series to generate a sine transfer function; what kind of multiplier would you use to raise the input to the 3rd and 5th powers? Some kind of translinear network?
I recall reading about an extension of fT multiplier and analog multiplier (Gilbert cell) type circuits, where you basically join more B-E's and collectors together in the right pattern and ratio of areas to create a sine (or cosine) function approximation directly, by adding up subsequent terms of the Taylor expansion. Cool.
Tim
--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.