LTSpice simulation of quadrant heterodyne pitch sensor.
OpAmp based Colpitts oscillator with 5mH inductor (air core 32mm frame 0.1mm wire 70mm winding), tuned to produce ~10KHz frequency change between near and far hand distances.
Analog switch based heterodyne with quadrant output: requires two reference frequency signals - with frequency 1-4KHz bigger than minimal oscillator frequency, two PI/4 phase shifted switch enable pulses, with duty cycle = PI/4 or even less (depends on switch performance).
Output of two LP filters can be feed to Line In since it's in audio range for tuned theremin.
LtSpice model:
Simulation: oscillator output signal and two reference frequency pulses for switch enable:
Single heterodyne ouput for different C_hand:
Heterodyne output FFT (peaks are not narrow enough due to short window length):
Two quadrants heterodyne output:
This signal may be sampled by MCU (e.g. using audio ADC) to calculate hand position from frequency.
Aplitude probably should be reduced to fit Line In range to avoid clipping (if ACD doesn't have pre-amp with K < 1).
Quadrant signals allow to eliminate amplitude changes - phase can be obtained using tan2() function.
Model to play with can be found on GitHub: sin_osc_opamp_v1.asc
If reference frequency is less than 400KHz, Teensy 4.0 is able to generate it with <4KHz step precision (divider from 150MHz timer base frequency should be divisible by 4 to have exact quadrant values). So, output of heteridyne will vary 1KHz..11KHz to 5KHz..16KHz depending on oscillator frequency, if oscillator is designed to produce frequency change 10KHz for full hand distance range.
So, it's ok to use internal PWM or Timer for producing 2 phase aligned ref signals.