Prev: Avalanche Photodetector
Next: Cheap potting alternative
From: Bitrex on 7 Mar 2010 04:48 Ban wrote: > Bitrex wrote: > >> 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: >> >> >> Triangle in 14V pk-pk >> >> o-------o-------------------- >> .-. | .-. >> | | - | | >> 1M | | ^ | | 150 >> '-' | '-' >> | | | >> | | | >> | | |-+ >> | | | >> -o--------o------>|-+ Sine out 1V pk-pk >> | | >> | | o---------o >> .-. | .-. >> 1M | | | | | >> | | V | | 150 >> '-' - '-' >> | - | >> ---------|----------- >> === >> GND >> >> (created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de) >> >> >> 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 <1% you can get only with 6 turn points if > adjusted well. > A differential transistor stage OTOH is capable of sine-shaping with a > minimum of 1.3% THD, with an additional clipping of the tops you can reach > almost 0.4%. > Another possibility is to develop the sine function into a power series > sinx = x - x^3/3! + x^5/5! - ... using only the first 2 terms you get 0.6% > THD, but you need 2 analog multipliers for that. Slightly modifying the > coefficients even 0.25% can be reached. This is very useful if the sin is to > be differentiated later. > > ciao Ban > > 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?
From: Tim Williams on 7 Mar 2010 04:55 "Ban" <bansuri(a)web.de> wrote in message news:hmvn5b$7nk$1(a)news.eternal-september.org... > Another possibility is to develop the sine function into a power series > sinx = x - x^3/3! + x^5/5! - ... using only the first 2 terms you get > 0.6% THD, but you need 2 analog multipliers for that. Slightly modifying > the coefficients even 0.25% can be reached. This is very useful if the sin > is to be differentiated later. 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
From: Ban on 7 Mar 2010 07:40 Bitrex wrote: > Ban wrote: >> Bitrex wrote: >> >>> 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: >>> >>> >>> Triangle in 14V pk-pk >>> >>> o-------o-------------------- >>> .-. | .-. >>> | | - | | >>> 1M | | ^ | | 150 >>> '-' | '-' >>> | | | >>> | | | >>> | | |-+ >>> | | | >>> -o--------o------>|-+ Sine out 1V pk-pk >>> | | >>> | | o---------o >>> .-. | .-. >>> 1M | | | | | >>> | | V | | 150 >>> '-' - '-' >>> | - | >>> ---------|----------- >>> === >>> GND >>> >>> (created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de) >>> >>> >>> 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 <1% you can get >> only with 6 turn points if adjusted well. >> A differential transistor stage OTOH is capable of sine-shaping with >> a minimum of 1.3% THD, with an additional clipping of the tops you >> can reach almost 0.4%. >> Another possibility is to develop the sine function into a power >> series sinx = x - x^3/3! + x^5/5! - ... using only the first 2 >> terms you get 0.6% THD, but you need 2 analog multipliers for that. >> Slightly modifying the coefficients even 0.25% can be reached. This >> is very useful if the sin is to be differentiated later. >> >> ciao Ban >> >> > > 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? .-------\ .--| | \ .------\ o--o---+ | X | >----| | \ .---------. Vin | '--| | / | X | >----|-0.543 | | '-------/ .--| | / | |---o | | '------/ .--|+1.543 | | | | '---------' | | | '------------------o-------------' (created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de) You need only the 3rd power for my above stated accuracy. With the shown coefficients for the subtraction you get 0.25% THD.
From: Ban on 7 Mar 2010 07:47 Darwin wrote: > On 7 Mar, 04:12, haroldlar...(a)porterland.com (Harold Larsen) wrote: > >> For example, to roughly approximate a sinewave without filtering. > > 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: > > http://www.national.com/an/AN/AN-263.pdf > > (see "Approximation Methods" paragraph beginning at page 8) > > Hope it helps. I downloaded the paper, but what they call *logarithmic* is IMHO *tanh* and that opamp is not connected very smart either (FIG. 11).
From: legg on 7 Mar 2010 08:54
On Sun, 07 Mar 2010 04:04:06 GMT, rontanner(a)esterbrook.com (Ron Tanner) wrote: >On Sun, 7 Mar 2010 14:31:48 +1100, "Phil Allison" <phil_a(a)tpg.com.au> >wrote: > >> >>"Harold Larsen" >>> >>> If a squarewave contains all odd harmonics of the fundamental >>> frequency, and a triangle all even, >> >> >> ** Sorry - that is WRONG . >> >> A triangle wave contains only odd harmonics too. >> >>http://en.wikipedia.org/wiki/Triangle_wave >> >>A "sawtooth" wave contains all integer harmonics. >> > >OK thanks for the pull-up, but how about using a triangle-square wave >mix, in place of a filter, to simulate a sinewave . > >I have not seen that method applied or described anywhere, but it >makes a fair approximation, at least to my eye. > >Harold Larsen > Maybe the news reader is confused, but 'Larsen' just posted as 'Tanner'. RL |