Let's Design and Build a (simple) Analog Theremin!

Posted: 1/3/2019 10:57:13 PM
markallie

From: Madison, WI

Joined: 5/19/2016

You can use LTSpice to create wav files. Search help for .wave. Here are a few lines from the help file.

LTspice can write audio files.  These files can then be listened to or be used as the input of another simulation.

Syntax:  .wave   V(out) [V(out2) ...]


Example: .wave C:\output.wav 16 44.1K V(left) V(right)

I've used this many times with reasonable results.

Mark Allie

Posted: 1/20/2019 2:59:38 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Franklin Oscillator

Over on the "basic experiments" thread [LINK] Dominique mentioned the Franklin oscillator, which was news to me so I thought I'd investigate it a bit over here so as not to disturb that thread.

Here's an LTspice schematic:

And here's the LTspice file if you want to play along at home: [LINK]

It's just a non-inverting amplifier with very small drive and sense capacitors going to the LC tank.  It just barely oscillates in simulation so I presume it's worse in real life, and so I'm disinclined to take this investigation beyond the sim phase.  If you run the sim you'll see rather significant phase shift from the input to the output of the amplifier, which is a tank voltage swing killer, particularly with high Q tanks.  Amplifier input and output are connected together, which rarely works well.  And the larger the tank L the more trouble it has oscillating.  And literally all of the components have to be tweaked in order to get it to do anything at all.  I could be missing something, but I would avoid this circuit if I were me.

There doesn't seem to be any magic analog oscillator topology out there that works optimally with untapped inductors.  By "optimally" I mean that generates the full tank voltage swing that a high Q inductor is capable of.  A 3.3V supply is capable of +/-1.65V at the drive side, which can ideally produce +/-165V with a Q=100 coil.  Single transistor types rely on phase error to function, and two transistor types have inherently high transport delay, which usually introduces more phase error than single transistor types.  My digital quadrature LC DPLL topology is the only thing I've encountered that approaches full theoretical tank swing.  The EW with low impedance LC driving a high impedance EQ coil is close, but it is non-linear - worse, it has two resonances that you have to worry about, one of which is environmentally-based.

Posted: 1/20/2019 5:04:26 PM
JPascal

From: Berlin Germany

Joined: 4/27/2016

Thank you, dewster, for estimation this oscillator type. The hint from Mark for making sound outputs in LTspice is super!

Posted: 11/10/2019 4:37:27 PM
Art Harrison

Joined: 3/17/2010

That is an interesting oscillator.

Posted: 11/12/2019 8:18:45 PM
markallie

From: Madison, WI

Joined: 5/19/2016

Art have you played around with this 2 transistor oscillator at 12V. I am still using your PNP differential oscillator in lab. Always works great. Gives roughly 6-8Vpp 400-500kHz or (300-350KHz)sine waves at the mixer inputs in our lab. I also added a resistor between the collector and the tank to control gain. I believe you mentioned doing this but decided not to bother.

Mark

Posted: 11/23/2019 4:03:28 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

RC LC OSC?

These two recent threads [LINK] [LINK] have got me wondering about the feasibility of some sort of RC LC oscillator "blend".  Have an RC oscillator drive a series EQ inductor L / antenna C, with that LC somehow "backdriving" the RC (or otherwise providing feedback).  High voltage and stable plus more pullable?  I understand that pullability isn't all that desirable in an analog Theremin, indeed it is often quashed via C padding, but more pullability would be welcome in digital and C sensor type applications.  I dunno, just a thought.  Might be easier to tune with a pot?  I suppose the LC resonance is rather invariant though, and the higher the Q the less you want to drive it off resonance.

Posted: 2/18/2020 3:49:34 AM
innominata

Joined: 2/9/2020

Good question!  FredM used to do a bunch of overnight sims in Spice to get just a few seconds of audio.
Googled it and found the *.wav out option for LTSpice:
.WAVE "c:/out.wav" 16 44100 out
Added the above to the spice file which generated a wave file, though it seems limited to +1V max, so I had to make the output resistor a voltage divider.  Lowered the frequency to 500Hz to get more harmonics in the human hearing range, manipulated the result in Adobe Audition (waveform replication to 2 seconds, DC offset removal, envelope) and saved as MP3 here.

If you had not done DC offset removal and what you refer to as "envelope", would your simulated audio give the same sound? At the moment it sounds a lot like an actual theremin.

My waveform looks like a train of positive half cycles and sounds almost exactly like a pure sine tone when I use the spice .wav directive.

The difference in our shapes is there is no spacing between the positive half cycles for mine and my positive half cycles are symmetrical, unlike yours in post 72.

Posted: 2/18/2020 4:21:48 AM
innominata

Joined: 2/9/2020

@dewster

After simulating your oscillator from post 72 and playing it the sound was a lot like mine.

Does the signal need to be centered at 0V to give it a healthier sound or was your post-processing what gave it the theremin hum?

Would you be able to explain the part about including harmonics as well? " Lowered the frequency to 500Hz to get more harmonics in the human hearing range,"

Posted: 2/18/2020 3:51:42 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"If you had not done DC offset removal and what you refer to as "envelope", would your simulated audio give the same sound? At the moment it sounds a lot like an actual theremin."

"Does the signal need to be centered at 0V to give it a healthier sound or was your post-processing what gave it the theremin hum?" - innominata

I removed the DC offset just as a matter of course in playing with the audio.  If you don't it can sometimes make "pops" and such when starting / ending.  DC, being below human hearing (and in fact not being a frequency at all) otherwise doesn't do anything to the sound.

"Would you be able to explain the part about including harmonics as well? "Lowered the frequency to 500Hz to get more harmonics in the human hearing range""

Harmonics are at 1x 2x, 3x, etc. the fundamental, and human hearing drops off around 10kHz, so lowering the fundamental includes more harmonics for the ear to hear.  Harmonics are what cause the sensation of timbre, so if you're working on generating them you should use a lower frequency so as to hear them.

Posted: 2/19/2020 4:34:55 AM
innominata

Joined: 2/9/2020

"If you had not done DC offset removal and what you refer to as "envelope", would your simulated audio give the same sound? At the moment it sounds a lot like an actual theremin.""Does the signal need to be centered at 0V to give it a healthier sound or was your post-processing what gave it the theremin hum?" - innominataI removed the DC offset just as a matter of course in playing with the audio.  If you don't it can sometimes make "pops" and such when starting / ending.  DC, being below human hearing (and in fact not being a frequency at all) otherwise doesn't do anything to the sound."Would you be able to explain the part about including harmonics as well? "Lowered the frequency to 500Hz to get more harmonics in the human hearing range""Harmonics are at 1x 2x, 3x, etc. the fundamental, and human hearing drops off around 10kHz, so lowering the fundamental includes more harmonics for the ear to hear.  Harmonics are what cause the sensation of timbre, so if you're working on generating them you should use a lower frequency so as to hear them.

Alright I get this much. The DC stuff I was mostly trying to make sure I didn't misunderstand a higher level reason for doing it.

It's easier to hear the harmonics if you reduce the frequency you're trying to play because they occur at multiples of the central or characteristic frequency. It also makes more sense as a musical instrument since 5Khz is already above the range of most musical instruments. So I get what you said about the harmonics but I don't understand how they were introduced into your mp3.

What I don't get is where the harmonics come from, between the mixer output and the speaker are we supposed to ensure harmonics are introduced?

Are we to introduce them prior to the mixing?

Are they already there somewhere? This could make sense since the envelope produced clearly isn't one frequency, then the question would be how to bring them out.

Basically I'm trying to understand why my .wav output sound like a pure sine tone and yours sounds like a theremin.

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