define(`TITLE', `Theremin')
define(`DATE', `2013-07-01')
define(`CONTENT', `
<p>
A <a href="https://en.wikipedia.org/wiki/Theremin" target="_blank" rel="noopener">Theremin</a> is a rather old electronic music instrument, invented in 1928. It is played by approaching hands to two antennas, without touching them. One antenna is used to manipulate the frequeny of the tone, the other one to manipulate the volume.
</p>

<p>
<img src="foto-am-30-06-13-um-20-021.jpg"/>
</p>

<p>
This is just another Theremin. Only basic structure of the circuit was taken from many other published Theremin circuits.
</p>

<p>
<img src="scan_005006-1024x654.jpg"/>
</p>

<p>
Completely new (or at least not found during my Theremin googling) is the digital zero-calibration.
</p>

<p>
The both left-hand-side oscillators together with the mixer+filter block provide the signal to control the volume, the right-hand-side oscillators and mixer+filter block provide the signal to control the frequency.
</p>

<p>
Each of these both couples consists of two oscillators and a mixer+filter block. Both oscillators have to swing on exactly the same frequency, in this case of about 1.3MHz. While the exact frequency does not matter, it is significant that both oscillators have the same frequency. The signals of both oscillators will be mixed, which means, multiplied.
</p>

<p>
[math]sin(omega_0 t) sin(omega t)[/math]
</p>

<p>
Here [math]omega[/math] is the frequncy of one of the oscillators while [math]omega_0[/math] is the frequency of the other one.
</p>

<p>
This term can be modified using the addition rule for trigonometric functions into
</p>

<p>
[math]frac{cos((omega_0-omega)t)-cos((omega_0+omega)t)}{2}[/math]
</p>

<p>
Due to this transformation, two signals, one with the sum and one with the difference of both input signal frequencies, are accumulated.
When both frequencies are exactly the same, one part of the sum appears as a DC offset, while the other part is the doubled frequency.
If one oscillator is de-tuned by only a few Hz'`s, one part are this few Hz'`s (a very low, hearable frequency) and the other part is still (roughly) the doubled frequency (a high frequency). The high frequency part can now be suppressed using a lowpass-filter.
Multiplication of two signals can be done using an analog four quadrant multiplier, like the AD633. So, this is the schematic of the mixer+filter block:
</p>

<p>
<img src="scan_005006_5-1024x717.jpg"/>
</p>

<p>
The output signal of this block is the difference of the detuning of the one oscillator.
</p>

<p>
Detuning of the oscillator will be achieved by approaching the hand to the antenna of the oscillator.
</p>

<p>
<img src="scan_005006_3.jpg"/>
</p>

<p>
The antenna acts as a kind of a capacitive sensor and by approaching the hand a very small amount of capacity is added into the LC resonator.
</p>

<p>
The other oscillator is a fix-frequency oscillator which can be tuned to swing on the same frequency as the first oscillator in a not detuned state.
</p>

<p>
<img src="scan_005006_4.jpg"/>
</p>

<p>
This tuning is achieved by biasing the two varactor diodes.
</p>

<p>
Here is automated tuning circuit steps in:
</p>

<p>
<img src="scan_005006_6.jpg"/>
</p>

<p>
The low-frequency output signal of the mixer+filter block is provided through a 2-to-1 multiplexer (the four NAND-gates) into a microcontroller. The microcontroller measures the frequency and as long as it is above a frequency [math]epsilon[/math] of say 10Hz, the bias voltage [math]U_{tune}[/math] is increased.
</p>

<p>
These both oscillators with mixer+filter and one channel of the zero-calibration appear twice in the whole circuit, one for frequency manipulation and one for volume manipulation.
</p>

<p>
The low-frequency, hearable, signal and the volume-control signal are brought together in the volume-control circuit
</p>

<p>
<img src="scan_005006_2-1024x553.jpg"/>
</p>

<p>
Here, the low-frequency signal [math]U_{Lf1}[/math] is passed through a high-pass filter. The high-pass filter is calculated that way that the whole detunable frequency range comes onto the ramp of the filter. So, the not detuned output signal of the mixer+filter is a DC signal, which is suppressed completely by the high-pass filter (beginning of the ramp) and the maximum detuned output signal of about 2kHz matched roughly to the end of the ramp. This filtered signal is rectified and only the negative half-wave of the signal passes the diode. This half-wave signal is sieved by the larger capacitor to get a DC signal between 0 and the maximum amplitude which passed the fiter. This negative DC signal is fed into the FET, which is configured as a voltage controlled resistor. This voltage controlled resistor and the fix resistor (5k6) are building a voltage controlled voltage divider. The hearable frequency signal [math]U_{Lf2}[/math] is fed into this voltage divider  and passed to an amplifier.
</p>

<p>
The output signal of this block in turn is the volume-controlled and frequency-controlled signal which is the output signal of this Theremin. It is passed into a power-amplifier and into a speaker - done.
</p>

<p>
<a href="https://www.youtube.com/watch?v=5US8LY_FbQ4&amp;w=420&amp;h=315">Calibrating the Theremin</a>
</p>

<p>
<a href="https://www.youtube.com/watch?v=lDld71HI66o&amp;w=420&amp;h=315">Playing the Theremin</a>
</p>
')