Let's Design and Build a (mostly) Digital Theremin!

Posted: 1/24/2014 11:08:12 PM
FredM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Yeah - Some things which are real easy in analogue, are a right royal pain to do digitally! - I give you that..

And as you say - there are advantages to your proposed solution.. The "look factor" is probably even more important with a digital theremin than an analogue one, as it probably acts to counteract predudice.

I suppose I was thinking more in terms of incorporating thermal correction directly on the AFE without  digital "interference" - As in, a thermal sensor driving a varicap or something similar..

Fred.

Posted: 1/24/2014 11:40:25 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

I ran across these plastic pipe clamps at the local Home Despot:

They clip onto 48mm OD plastic pipe (plumbing or conduit) nice and tight:

In real life you wouldn't clamp right on top of the windings like above.

The above assembly fits surprisingly well inside of plastic fencing:

Maybe nylon hardware to secure it all.  Or use larger diameter piping with holders built into the end caps.  Still looking for end caps, though I'm not 100% committed to this road yet.

Here is a quick sketch of design I thought of a while ago (2013-08-23):

The pitch coil would be inside the main upright, pitch antenna on top with mic stand mount on bottom.  Out the side is the control section at a 45 degree rotation, with two volume antennas protruding from the free end.  Maybe make the control section removable for portability, but I'm not sure what connection might be used for that (strong mechanical joint, 4 electrical conductors).

It needs more of a Jetson's toaster look somehow. ;-)

Posted: 1/25/2014 1:03:17 AM
FredM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

I like the look of that a lot!

An idea for connectors - you could have 4 jack PLUGS protruding out the control unit, with sockets in the antenna unit - if these are stereo jacks (6.35mm) you get 8 connections + ground..

Ive been looking at similar coupling problems - I want to be able to have my theremin universal LH / RH, and been looking at ways to achieve this without much added cost or complexity - having sockets on both sides for pitch and volume, and detecting which anrenna - that sort of thing - Your scheme shown (particularly if you have encoders not pots) could probably do this elegantly, simply by changing which sockets the controller plugged into in order to get the right angle for either a LH or RH player, (rotate the pitch unit so the sockets faced the less dominant hand, then plug the controller / volume unit in) the orientation could be determined and the display / encoders configured for this orientation..

No need for a toaster look IMO. but a slight risk of a parking meter look.. But who cares? The E-Pro fetches a good price despite being branded an Ikea reject! ;-)

Fred.

Posted: 1/25/2014 6:04:31 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Ive been looking at similar coupling problems - I want to be able to have my theremin universal LH / RH, and been looking at ways to achieve this without much added cost or complexity - having sockets on both sides for pitch and volume, and detecting which anrenna - that sort of thing - Your scheme shown (particularly if you have encoders not pots) could probably do this elegantly, simply by changing which sockets the controller plugged into in order to get the right angle for either a LH or RH player, (rotate the pitch unit so the sockets faced the less dominant hand, then plug the controller / volume unit in) the orientation could be determined and the display / encoders configured for this orientation.."  - FredM

Interesting.  If the connectors were arranged in a square there would be 4 possible ways to plug it in, two of them invalid.  I don't think 1/4" connectors are beefy enough to do this though (the square plastic tubing weighs 1.65 kg/m)?  I do plan on using rotary encoders (two should give a lot of input possibilities - select thing to change w/ the first, change its value with the second) but the 7 segment displays I'd like to use have decimals across the bottom only.

I'd really like the pitch coil to be physically separated from the heat and noise of the electronics, which this design addresses pretty well.  The antenna end of the pitch coil is sensitive to proximity, so placing it vertically under the pitch antenna makes the most sense.  I think one can likely use a shorter pitch antenna this way (not that that matters much).

The vertical and horizontal tubes could be made the identical lengths, somewhere around 300 - 350mm (12" - 14").  Would look something like Theremins later designs (his "Enron" big U shape).  The actual inductance of the pitch coil isn't critical.

Here are some PA equipment corners that fit the square plastic tubing like a glove:

They're Penn Elcom C1567, got 8 off eBay for $4.

Posted: 1/26/2014 9:01:02 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

To Heterodyne, or not to Heterodyne?

I'm kinda dense when it comes to many things I had entire classes on in college.  Like SNR (signal to noise ratio) and the like.  It's really been holding be back in my digital Theremin design.

It does seem that there is a resolution advantage to doing heterodyning, and I suppose it's obvious due to the huge pitch change a regular analog Theremin gives you for a fairly small change in capacitance.  This increase in resolution is particularly helpful if you can't sample the period very quickly, but it is also useful if sampling at, say, 100MHz.

Say we have an LC oscillator that runs nominally at 100kHz, we're sampling it at 100MHz, and we want pitch numbers at a 1kHz rate (for responsiveness).  Say also that the bulk antenna capacitance is 5pF, with a 1pF delta when the hand is near the antenna.  If you work the LC resonance backwards for 100kHz & 5pF you get L=506.603mH.  With this L and 6pF you get 91.287kHz (when the hand is near).  Granted this L is pretty big, but stay with me.

Without heterodyning: we can divide the 100kHz down to 1kHz (1/100), then sample this with our 100MHz clock, which gives a period count of 100MHz/1kHz = 100,000.  91.287kHz through the same divider gives a period count of 100MHz/0.91287kHz=109,544.  The difference is obviously 9544.  Log2 of this is 13.2, which means we get 13.2 bits of pitch information for the entire pitch range.

With heterodyning: say we use a fixed 90kHz beat frequency.  100kHz-90kHz=10kHz, and 91.287kHz-90kHz=1.287kHz.  Sampling both of these directly with our 100MHz clock, we get 100MHz/10kHz=10,000; and 100MHz/1.287kHz=77,700.  The difference is obviously 67,700.  Log2 of this is 16.05, which means we get 16 bits of pitch information for the entire pitch range.  An increase of ~3 bits, or 18dB, or a factor of 8.

So there seems to be a clear resolution advantage to heterodyning when the operating frequency is significantly above the pitch number rate (e.g. here we have 100kHz >> 1kHz).   If we could easily use huge inductors I believe this advantage would largely disappear.

Other than the simplicity, one nice thing about not heterodyning is that most of the value change happens near the antenna, giving higher resolution where one is more likely to hear stepping and such in the associated higher pitch, with less change in the far field bass region where one is less likely to hear pitch stepping.  (EDIT: I think this is true regardless of whether one heterodynes or not.)  And if there is a sensitivity adjustment available to the user, he/she is most likely to dial it down to something reasonable and easy to play like a 3 octave total range, which will effectively increase the resolution.  But if there is a pitch offset adjustment available to the user and he/she jacks the far field up quite a bit, the wider steps may become audible.  One could run the pitch number through a auto-variable cutoff LPF, so that the far field resolution would be increased at the expense of response time, but leave the near field response essentially unchanged.  Kind of a poor man's adaptive filter.

One thing that's weird about heterodyning to get a pitch number in this manner is that you will likely end up with a null point very near the antenna. (EDIT: this isn't necessarily the case.)  This can be dealt with I suppose by simply limiting the maximum period.  One thing that's good about heterodyning is the period increases with decreased hand distance, forming a natural pitch number.

I'm still investigating heterodyning.  In particular, I'm wondering if it is feasible to do it digitally inside the FPGA and still experience this resolution gain.  Also, significant noise may (or may not) reduce the resolution advantage.

I will also say that after doing the above mental exercise, it is quite clear to me that a simple divider followed by a period measurer behaves just like an analog integrate and dump circuit (which is often an ideal receiver).

Posted: 1/26/2014 10:03:57 PM
FredM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

"I'm still investigating heterodyning.  In particular, I'm wondering if it is feasible to do it digitally inside the FPGA and still experience this resolution gain. " - Dewster

Still chewing on the other issues above - But this one has me puzzled - Whats the problem or difficulty with digital heterodyning? All you do is take one oscillator to the CK of a D latch, and the other oscillator to the D input of this same latch.. The output is a square wave at the difference frequency of the to input oscillators.

If you dont have 2 "actual" oscillators, but one or even both of them are in a numeric form, then the number/s can be fed to a divider and produce a real clock ("oscillator") to drive the D latch input/s..

You also have huge versatility if you process each oscillator prior to "heterodyning" by rhe same function - For example, multiply or divide the frequency of both independently  with a PLL or divider each, by a common multiplicand or divisor, and after heterodyning the difference frequency will have been multiplied/divided by this same multiplicand/divisor..

I believe this idea is at the core of the E-Pro register switching - I have used it mainly to multiply the difference prior to doing pitch to voltage conversion, as it allows latency to be reduced by the same factor as the multiplicand - I multiply by 10, so a 10Hz audio (100ms latency if resolving the voltage in one cycle)  becomes 100Hz (10ms latency) when fed to the converter.. This allows tracking to go down to my limit (16Hz) with less than 7ms latency,and latency is always only about 100us more than 1/10th of the period of the audio waveform. 

Added -> Thinking about the above, could it be a good hybrid way of getting the numbers? Do the multiplication and heterodyning in the FPGA, use the multiplied difference to drive the period to voltage logic inside the FPGA, take the pulses from this logic (used to discharge the external analogue linear period integrator and drive the analogue SAH) then feed the period voltage back to a FPGA based ADC? - One of my main interests in FPGA is to mop up all the logic - the divisors for the PLLs and the discharge / SAH sequencing required for voltage output and my OKE.. And to put all the mixed signal waveshaping stuff in it.. Quite funny really, I have a problem finding sufficient things to put in it to justify it being there! ;-) .. The real pain is that its so big! - I wish I could have a load of smaller PLD's so I could have one in the basic build, and others in add-ons, but having one big one almost forces me to include everything in the basic build.. but at about £8+ for a 22V10 vs £12 for a Cyclone 2, (not to mention having to use DOS PALASM or ABEL for the 22V10, and programming / debugging headaches)..

Although I have never tried the following (PLD's and Processors I have used in the past werent nearly fast enough) I suspect that it might be possible to do a massive PLL multiplication on the input frequencies to obtain an absurdly fast difference frequency one could count for some fixed period (say 3ms) and derive a numerical value from this - its one of the things I was intending to look at with my new FPGA DK... But I havent even done back-of-envelope sums on it yet... Even with the speed of FPGA's I think they will probably be too slow for this scheme to produce sufficient resolution.

Fred.

 

Posted: 1/26/2014 11:01:47 PM
FredM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

Question: Pals / Gals

Dewster, I was wondering if you have come across or ever used these TIB PAL's :

http://uk.farnell.com/gals-pals

The price is really low - But I am not able to find any useful data or software / development stuff for them.

If you know anywhere I can get low cost (or free) software or have any information, I would be most grateful.. I am particularly interested in the 77p R4 part, (http://uk.farnell.com/texas-instruments/tibpal16r4-25cn/pal-circuit-impact-hi-perf-20dip/dp/1652253) as it has everything I need to implement my full basic mixed signal voicing on one chip.. But none of the software I have has anything like this part in its device list.

Fred.

Posted: 1/27/2014 3:18:28 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Very sorry Fred, I have no direct experience with PALs/GALs.  Cut my teeth on CPLDs.  Have you tried contacting TI?

Posted: 1/27/2014 3:52:54 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"Whats the problem or difficulty with digital heterodyning? All you do is take one oscillator to the CK of a D latch, and the other oscillator to the D input of this same latch.. " - FredM

Or, semi-identically: sample one input looking for rising edges, when one is detected capture the sampled data on the other input.  This keeps the logic operating within a single clock domain.  If one could sample the input at a higher rate, one could examine the NCO accumulator (the source of the rising edge) to get more accurate phase info.

Intuitively it seems like all of the information is already there before heterodyning, and if you are sampling with 100MHz then that's that.  But heterodyning seems capable of pulling even more info out, which seems kind of magical, and I suppose that's why it's taken me so long to entertain it.

Here is another way (the way I've used in the past): LPF the DPLL operating point.  We get 100MHz/100kHz=1000 or ~10 bits of resolution at a 100kHz data rate.  If the LPF is set to 1kHz then we get an improvement of (100kHz/1kHz)^(1/2)=10 or ~3.3 bits of resolution, for a total of 13.3 bits.  But only part of this is usable obviously because the operating point won't go from 0 to max in the playing range, which drives the resolution back down.

The output is a square wave at the difference frequency of the to input oscillators."

I'm going to have to try this in an FPGA.

"You also have huge versatility if you process each oscillator prior to "heterodyning" by rhe same function - For example, multiply or divide the frequency of both independently  with a PLL or divider each, by a common multiplicand or divisor, and after heterodyning the difference frequency will have been multiplied/divided by this same multiplicand/divisor.."

FPGA PLLs tend to not go very low, e.g. for the Cyclone 4 I'm using the minimum input is 5MHz.

I think the DPLL construct I'm using, which is actually a DLL (delay locked loop), can be simplified quite a bit.  The XOR phase detector can likely just feed an up/down counter (phase error accumulator), which then feeds an NCO (with the usual dithered accumulator to reduce spurs).  No need for an integrate and dump phase detector or explicit loop filter.  Events can be seen as taking place naturally on the output edges, because the outside world only "sees" the edges, not the running accumulator value, so the FM introduced by the up/down phase detector triangle is effectively masked.

The dithered square wave then used as LC drive, and is also routed to the heterodyning stage.  The thing I don't like about heterodyning is it needs two numbers - the DLL initialization point and the heterodyning frequency point - as well as an extra NCO, period counter, etc.  The good thing is it seems to dramatically increase resolution, so passive antenna shielding might be an option.

Posted: 1/28/2014 11:51:37 PM
FredM

From: Eastleigh, Hampshire, U.K. ................................... Fred Mundell. ................................... Electronics Engineer. (Primarily Analogue) .. CV Synths 1974-1980 .. Theremin developer 2007 to present .. soon to be Developing / Trading as WaveCrafter.com . ...................................

Joined: 12/7/2007

" The antenna end of the pitch coil is sensitive to proximity, so placing it vertically under the pitch antenna makes the most sense.  I think one can likely use a shorter pitch antenna this way (not that that matters much)." - Dewster

Yeah, I like vertical mounted coils for the same reason...

And now an idea which should probably be in the "crazy ideas" thread..

How would a combined coil / antenna behave? (I honestly have absolutely no idea..) .. Lets assume that one needs a 10mH inductor, but used an 9mH inductor, and connected this to a coil wound oner the length of the antenna which had a total inductance of 2mH..

The 10mH point would be somewhere near the centre of the antenna, but the antenna coil could be wound in a way that placed it exactly in the centre - the whole antenna coil would be "seeing" background and player capacitance...

I suppose I am thinking more about this in the usual series LC EQ scheme - would Y axis hand movement shift the resonant point (I think it would) but also, would the combined effect possibly improve linearity?

I know this looks like an idea from somewhere else ;-) but its entirely different - one is actually using the antenna coil as a sort of infinitely tapped capacitively coupled inductor...

?

Fred.

You must be logged in to post a reply. Please log in or register for a new account.