Trigonometry stabilized sine wave

A modern implementation of a technique first proposed by Stanley Fifer in “Analogue Computation: Theory, Techniques & Applications”.

The core of the circuit is a basic state variable sine oscillator formed around X1 and X2 opamp integrators. U5 and U1 give voltage controlled gain which controls frequency. These devices are 4 quadrant multipliers and as such could be used for through zero frequency modulation. Linear response limits the dynamic range and frequency response, probably 40hz to 4Khz here. This was from an experimental design stage and an exponentially responding VCA such as the THAT2180 may be more appropriate. The state variable topology (also called the harmonic oscillator) is based around a solution to the Ordinary Differential Equation X = -d2y/dx^2 , proper analysis of which can be found from several texts.

A state variable sine, unlike a triangle core oscillator, does not have voltage limits guaranteed by the comparator that changes direction of control current into an integrator. Left alone, depending on the gain/frequency settings and how they change the parasitic terms such as PCB resistance and parallel resistance across the integrator capacitors, the oscillation will either damp out or ascend to the rails.

The hard part of a this kind of design is therefore how to stabilize the oscillation without adding distortion. The basic feedback loop that generates the Sine has very few errors, mostly the limited phase response of opamps, as well as losses or mismatch in passive components and the error per cycle is only several mV or less, but unfortunately this quickly accumulates with potentially destructive results.

Examples of successful amplitude stabilization techniques include the HP8903 Distortion Analyzer which includes an onboard reference sine. In this topology, at the zero crossing of the Cosine, a sample is taken of the Sine level which will be at its positive and negative peaks. These can be compared against a reference value and the level can be adjusted accordingly.For a synthesizer, I felt this would not respond quickly enough under fast modulation. This topology was updated by Samuel Groener in published research who quoted an astonishing distortion performance of -140dBc.

A solid performance design is http://www.aes.org/e-lib/browse.cfm?elib=14135 . The most common technique in amplitude control is to clip the sine output with diodes and feed this back positively. This injects energy into the system when the output is at it’s lowest level. Zener diodes are also used to damp the circuit when it reaches it’s peak value. The baxandall configuration feeds back both in such a way as to cancel the distortion of each.

Another idea would be to use RMS level detection, although it takes several cycles to get a useable RMS value, this therefore cannot respond quickly to abrupt changes in amplitude, and also has a tendency to overcompensate and then undercompensate creating unwanted amplitude modulation.

So now we reach this idea. I was fascinated with the idea of real time control, and various ideas were considered,then discarded. I began studying trigonometric identities as a these are a set of fixed geometric rules that determine how these waves relate to each other and surely contained the key to create a way for the circuit to always know where it is versus where it should be. Here the identity Sine² + Cosine² = 1 is used. Rearranging to Sine² + Cosine² – 1 = 0 gives us real time error value as whatever 0 is, is the real time error of the circuit. This value is then multiplied by one of the integrator outputs and fed back to the integrator input to give regenerative or degenerative damping according to the real time error.

+10 that is fed to X3 is a precision 10 volt source. This is an earlier iteration of the circuit and there are multiple improvements that could be made for improved performance. One hint is that the optimum dynamic range of the AD633 is -/+10V. As depicted, the oscillator outputs are +/-5V, with the outputs from the multiplier scaled down to -/+2.5 (as the internal operation is to multiply X input by Y input then divide by a fixed denominator of 10V).

sine cosine open source

88x31This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s