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

Posted: 10/31/2012 8:27:22 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Does anyone else experience strong 50Hz or 60Hz interference with their Theremin(s)?

Instead of working on linearity like I should be, I've been thinking about AC interference in Theremins.  On my EW it can get pretty bad depending on where in the house it is plugged in.  When it's really bad it sounds like 60Hz is strongly FM modulating the voice so it's easy to make motorcycle-like sounds on the low end.  Which can be fun if you're in a playful mood, but could make you gray prematurely if you're looking for more of a pure tone.  Then again this could be related to the crappy 9V battery powered "afterburner" guitar amp I've got it plugged into.

My digital Theremin prototype doesn't seem to have much 60Hz noise on the output pitch numbers, but it does have some bobble on the lower digits that could easily be due to mains interference.  It's pretty much confined to sitting on my work bench, so I haven't tested it in various parts of the house, though it does sit right next to two fluorescent desk lamps and and one LED desk lamp.

So I've been thinking about how to filter 60Hz and its harmonics out of the pitch numbers.  I've read tons of papers over the past few weeks, and finally found the one I was looking for today (my Googling powers seem to be weak lately):

http://ecad.tu-sofia.bg/et/2008/ET2008_Book1/Electronic%20Medical%20Equipment/25-Paper-T_Neycheva1.pdf

I hooked an alligator clip to the input of my PC sound card, recorded a bit of my desk electrical environment, and examined the resulting FFT.  There are peaks only at the odd harmonics: 60Hz, 180Hz, 300Hz, etc. so it looks like the sharpened comb filter of that article may do the trick.  I was looking to use a CIC (or boxcar, or moving average, they are all fundamentally the same) as it kills all harmonics with integer periods that fit in the delay, and some forms importantly preserve DC, but I believe it would lower response time unacceptably.  Probably better to have a higher Q comb followed by a first order low pass filter, but I guess I'll find out! 

The current design uses the roll-off of the PLL and a first order low pass filter, and it's really pretty good, but I wonder how far I can push it (ruh-roh: self-induced feature creep=masochistic personality disorder).  There is a bit of flutter you can see on the "tuner" display when playing low notes further out that is sometimes a little audible.  Another non-ideality I've seen is when playing very near the antenna (say 2" or less) then quickly pulling way back to near the null point, I see the pitch first jump down as expected, and then float down a bit farther slowly over several seconds, with a time constant similar to a component cooling off.  I wonder if this is coil heating with the increased capacitive load of my hand?  Not sure what to do with it, though I will say the "tuner" makes all kinds of things visible that one might not otherwise notice sonically, and therefore makes it a scary thing to include on a potential customer product!  It's literally almost too analytical, which is its power I suppose (and for that I can't imagine not including it in any Theremin I might design / produce).

Posted: 11/1/2012 5:40:09 PM
Chobbs

From: Brooklyn,NY

Joined: 12/1/2009

" I noticed that the entire TW theremin project has almost been "hijacked" because (primarily, I think) of Uncle Howie's "It should be like a RCA" intervention.."-fred

 

(in steve urkle voice) 'Did I do that?'

Posted: 11/1/2012 6:31:44 PM
Amethyste

From: In between the Pitch and Volume hand ~ New England

Joined: 12/17/2010

Dewster wrote: "It's an incredible honor to be able to chat and swap ideas with some of the world's most knowledgeable Theremin designers, builders, and players here at TW."

 

... And it is an honor to be able to share the enthousiasm of the builders and to also read a bunch of scientific (and at times not so scientific) garble that my pea sized brain cannot even begin to grasp...

Without you guys, I'd have no theremin to play :) Keep it going!

Posted: 11/1/2012 6:40:08 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

"(in steve urkle voice) 'Did I do that?'" - Chobbs

Yes! I think it fair to say that had you not communicated the Levnet stuff, it is extremely likely the whole RCA examination would not have happened - And it was you who, when I presented the first "clone" oscillator, questioned the importance of the specific tank coil construction - which caused me to simulate using balanced windings, which caused anomalies - which led to the realisation that component data provided by previous examiners were wrong and deduced from wrong assumptions, and which led to discovery of how the oscillator really worked.

The above, to me, is one of the most exciting examples of synergy in action that I have been part of - You triggered it, or perhaps Uncle Howie did with his email to Levnet a year ago and you "conducted" this to us - Whatever - The communication between you, Rob and myself led to understanding of the REAL operation of the Lev oscillator.. IMO, even if nothing more was to come of the TW theremin (I have always viewed the RCA analysis as seperate from the TW theremin project) , this has been an enormous advance in theremin understanding and this understanding must be good for theremin development.

What I was trying to convey with my >>"the entire TW theremin project has almost been "hijacked" "<< Was that I do not think the TW theremin should be defined as or limited to the idea that it "must be" a RCA clone - There are  criterion which were being laid down, and I feel that it would be a good idea for these to be revisited - that the development goals be clarified first, and then the TW theremin/s "defined".. And I think there is room for digital and analogue (and mixed-signal) to be looked at - I do not think now is the time to say "the TW theremin as a RCA clone".

In summary - I think the analysis of the RCA, and any possibilities for cloning an RCA due to such analysis, is a seperate "project" which has been primarily academic.. I do not see this "project" as the "TW Theremin project" although I do think it likely that the knowlege from the "RCA Project" could feature strongly in some "TW Theremin" implementations.

Fred.

Posted: 11/1/2012 7:48:08 PM
Chobbs

From: Brooklyn,NY

Joined: 12/1/2009

Im just honored that other thought something I posted was interesting.  Too frequently I feel like my post is the 'thread killer'

 

 

Posted: 11/1/2012 9:22:26 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

I've spent the day simulating the High-Q comb filter in that paper I pointed to.  If anyone wants to play with the Excel file it is here:

http://www.mediafire.com/?wcln9pdeqn4ehkc

Wow, for being such a simple construct it's one heck of a filter (at least in simulation).  I've read lots of papers on eliminating mains interference from biological monitors such as EKGs, EEGs, etc. where the signal is tiny, buried in noise, has significant information in frequencies above 50/60Hz, and where the time domain representation is important for human visual interpretation.  This thing seems to work as well or better than adaptive filtering or nulling techniques which are way more complicated to implement.  Surprisingly, a higher Q, with relatively constant amplitude interferers, leads to a pretty high fidelity transfer in the time domain.

Posted: 11/2/2012 12:30:44 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

Hi Dewster -

"I've spent the day simulating the High-Q comb filter in that paper I pointed to" - Lol, after having read that article and your comments, I fear I could spend a day or more doing the same! At least I have your spreadsheet to speed things up if I yield to this distraction - It does look interesting!

I had a lot of problems with mains and other interference when developing my Epsilon (3d "theremin" project) - This project used "digital" oscillators with "antennas" (horizontal capacitive sensor  plates) at logic level - I tried various methods to reduce these problems.. small coupling capacitors to the plates reduced the LF pickup (below about 50kHz) to acceptable levels, but my problems were only hidden by doing this - when everything was boxed up, HF radiated signals inside the box were picked up and caused havoc with my hand position detection.. (the LCD drive was the major issue - the LCD had been seperated during development, when it was close to the plates everything fell over!)

I solved all the problems by switching to analogue LC oscillators which drove the plate potentials up above 50VRMS - Never solved the problem that the idea was unworkable and the instrument unplayable without modification to the thereminists body and brain.. ;-)

With a high antenna amplitude and a suitable sized series antenna capacitance (one is looking at a background capacitance of perhaps 12pF with hand capacitance change of perhaps 1pF, so a series NOP 100pF capacitor has only a tiny effect on sensitivity)

100pF represents about 8kR @200kHz and about 25MR at mains frequencies - or about 70db attenuation of mains  - most predominant mains harmonics are below 2kHz, and 2kHz is attenuated by about 45db by a 220pF..

With high amplitudes on the antenna and a series capacitor, I have found that problems usually come from high frequency signals coupled via the antenna (and the higher the antenna circuit amplitudes, the less of a problem I have found all antenna coupled interference to be) - (until the antenna starts arcing that is.. ;-), or low frequency signals coupled to antenna inductors (and other inductors on the board, but these are usually a lot smaller and less of an issue..

Antenna inductors can be a big problem, as there can be a lot of turns on them.. If this is the cause of the problem, moving the antenna series capacitor to the connection point on the oscillator (or adding another series capacitor - having one 470pF between oscillator and antenna inductors, and one 470pF between the inductors and the antenna - Yeah! - I know.. shouldnt make a difference, but I have found it does! )

Fred.

Posted: 11/4/2012 3:41:45 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Fred, thank you so much for that hard won info!  I put a 470pF between the antenna and "linearizing" coil and am now seeing improved SNR (less bobble with the pitch numbers) - amazingly simple, and it makes sense!  Good thing you aren't here or I might have kissed you! ;-)

Too many EEG signal conditioning papers had me out in the weeds.  The Theremin of course makes its own signal, which is much higher in frequency and much larger in amplitude than most biological signals.  Analog filtering at the antenna makes infinite sense.

The day before we had another ~8 hours of no power, but yesterday I was able to put the 60Hz comb filter in the prototype and play with it some.  Not seeing any change at all with it in or out of the signal path.  Also played around again with noise shaping of the PLL NCO dither - nothing substantive there either.  I do see a lot of interference at low frequencies between the PWM audio output and pitch - if I unplug the headphones it clears up.  High time I suppose to switch to a real DAC.

The "coil in the antenna" is still flaky, even with the series cap in the antenna itself.  May try it again down the road at some point but will abandon that idea for now.

Posted: 11/5/2012 3:42: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 put a 470pF between the antenna and "linearizing" coil and am now seeing improved SNR (less bobble with the pitch numbers)" - Dewster

Glad to have helped!

470pF is still quite big if its the only series capacitor in the antenna path - I found a good rule of thumb was to have total series capacitance no greater than about 250pF (and unless one is doing something peculiar, no less than 100pF).. As in, one 470pF between oscillator and equalizing inductance, and one 470pF between antenna and equalizing inductance - and one can usually reduce these to 220pF each, which marginally reduces sensitivity, but further reduces LF noise by a few db, and also seems to slightly improve linearity.

I have  no idea why having a capacitor on both ends of the EQ coil improves things, but I have found that it can.. I found that a 220pF on either side was better than a 100pF on one side - It may have perhaps been something to do the inductor windings coupling directly to some other path or ground due to layout or whatever, and having it "isolated" by 2 capacitors eliminated this path - but this still doesnt account for the improvement I saw when I did this - even for the sloppiest of layouts - and my layout was tidy!

Fred.

Posted: 11/5/2012 4:01:12 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

"Im just honored that other thought something I posted was interesting.  Too frequently I feel like my post is the 'thread killer' " - Charlie

Its not a nice feeling that... But its usually just normal paranoia which everyone one in the universe suffers from! ;-) (just quoting Slartybartfast from "Hitchhikers guide to the galaxy" :-)

The other thing to keep in mind when posting is that these postings are read by many people who never show their face on TW - Most emails I get about theremins (and often other electronic matters) come from people reading the posts who are not members of TW.. TW seems to be trawled extensively by by the Google Bot - Things you post here are quite likely to appear on the first page if you search using Google.

I have sometimes made a posting here, and had some doubt about the accuracy of what I have just said.. So I go and search on Google just to check - and find my posting, made minutes before, appear near the top of the search results!

So just because a thread "goes quiet" after you make a posting doesnt mean its "worthless" or "a killer" - Sometimes it just means that you have said all that needs to be said. .. But like I said, it can feel uncomfortable! I used to hate it! I had dozens of threads where I was the last one to post - It felt like a curse! ;-)

Fred.

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