Fred's Notebook - CV's PLLs and more..

Posted: 5/17/2012 9:02:15 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

 

**REMOVED** I have removed this content for commercial reasons.If you are interested in obtaining this information, please email me - I am happy to help those genuinely interested, but not happy to be ripped off and taken for granted!

I will not be visiting or contributing to TW much in 2013, and am unlikely to be replying to any threads.

Please feel free to contact me by email.

My email address is shown on my avatar.

it is:

fred

at

fundes

dot

co

dot

uk

 

Posted: 5/17/2012 10:45:08 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

Correct me if I'm wrong:

2 analog oscillators => 2 analog multiplying PLLs => mixer => DSP (or similar).

Why not just measure both oscillator periods directly with digital logic running at 100MHz or so, digitally low pass filter to increase precision, then subtract?  A CPLD or tiny FPGA (MachXO) could do this pretty easily.  The capture time would be constant (the low pass filter cutoff point) rather than dependent on the period of the heterodyne difference frequency.

Get a slightly larger FPGA and do the log2, DAC, and MIDI stuff (if desired) in there as well and kiss calibration and drift (of this downstream circuitry anyway) goodby.

Posted: 5/18/2012 12:32:42 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 am probably misunderstanding what you are saying here.. your diagram showing

2 analog oscillators => 2 analog multiplying PLLs => mixer => DSP (or similar).

[[except that DSP is replaced with analogue pitch to voltage - DSP could probably do the job, and may even be a better solution if resolution was high enough and latency low enough]]

makes more sense to me..

IMO, If we took the oscillator periods directly, and measured these periods using 100Mhz, then for 250kHz we would get 400 counts, and for 251kHz we would get 398 counts..

We need a resolution of better than 14 bits (16384) to obtain full coverage of the audio spectrum with 1 cent resolution - and I believe this is required to eliminate any effects of the quantizing which would otherwise occur. Reducing the span (number of octaves) one could perhaps go down to 12 bit (4096) but that is, IMO, as low as one could possibly go, even with filtering.

One could increase the resolution greatly by taking the period of (say) 250 oscillator periods - in the case of 250kHz, this would be a period of 1ms, and one would end up with 400*250=100k counts for 250k and 99.5k counts for 251kHz.. but this still only gives 500 counts (difference) over a range of several octaves! - only if we extended the count over 2500 oscillator cycles (10ms) do we start to get into the kind of numbers we need.

I am probably being stupid - I once persued this route, and it seemed to hold promise.. I was not so aware, back then, of just how important speed of aquisition really is - I was thinking that 10ms was fine, I no longer believe it is fine - it may just be borderline.

It seems to me that heterodyning the signals is far more straightforward.

But I may have got it all wrong -

Fred.

Posted: 5/18/2012 3:19:38 AM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"We need a resolution of better than 14 bits (16384) to obtain full coverage of the audio spectrum with 1 cent resolution - and I believe this is required to eliminate any effects of the quantizing which would otherwise occur. Reducing the span (number of octaves) one could perhaps go down to 12 bit (4096) but that is, IMO, as low as one could possibly go, even with filtering.

One could increase the resolution greatly by taking the period of (say) 250 oscillator periods - in the case of 250kHz, this would be a period of 1ms, and one would end up with 400*250=100k counts for 250k and 99.5k counts for 251kHz.. but this still only gives 500 counts (difference) over a range of several octaves! - only if we extended the count over 2500 oscillator cycles (10ms) do we start to get into the kind of numbers we need.

I am probably being stupid - I once persued this route, and it seemed to hold promise.. I was not so aware, back then, of just how important speed of aquisition really is - I was thinking that 10ms was fine, I no longer believe it is fine - it may just be borderline."

You're not being stupid at all, these are exactly the the same back of the envelope calculations I went through designing the digital Theremin, and why I have the digital figure of merit (DFOM) in my spreadsheet, and one of the reasons my AFE runs at 700 kHz.  And yes it is borderline, though I think 3 cents and somewhere around 10ms might be enough, depending on what I can manage to filter out.

"It seems to me that heterodyning the signals is far more straightforward."

It strikes me as a bit roundabout, and you have the not insignificant drift of two oscillators to worry about (though an argument for "drifting together" can be made - I still think it's drawback and requires the oscillator transistors to be on the same substrate to really work).  But we as engineers obviously need to do whatever we need to do in order to get the job done - yours does produce more significant digits in a more timely manner, and my digital design is still rather borderline on the low end.

I haven't entirely thought this through, but won't the x8 PLL frequency multiplication make the difference frequency drift 8x worse? 

I think all solutions are one way or another mired in SNR issues.  As you know we're talking femto Farad changes here which can be easily dwarfed by environmental and thermal noise.  Most people will say it's because of linearity, but I believe one of the main reasons the LC tank finds its way into virtually all Theremins is because it is a high Q band pass filter, which lets the signal through and limits noise pickup.  SNR.

Posted: 5/18/2012 4:02: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

To me, the wonder is that we are here, in the 21st century, decades after Lev built his first theremin - And whilst we are starting to approach the resolution and beauty of his creation, we aint there yet!

If one looks at the complexity of even the simplest FPGA or DSP, and compares that against the simplicity of Lev's design - And one then compares the performance of what we are creating (or hoping to create) with our vast computing resources available in tiny cheap packages, to what he created, and the great instruments which have been built, barely changed (except sometimes to make them cheaper and less beautiful) and played for these decades..

Oh, I know all the technical reasons etc - but sometimes I like to immerse myself in childlike awe at how, with so little, so much can be done.

A lot of mystical things have been said about theremins - Oh, I dont buy any of it (LOL!) - ;0).. But one thing stuck - it was: "You dont find your theremin, it finds you"

I have this mystical sort of feeling sometimes - I KNOW the theremin I want, and it doesnt yet exist - I have heard it, and played it, in my imagination and dreams. Its a bit like knowing a child before its been born... Oh, I feel REALLY STUPID saying things like this, LOL ..

But I sometimes wonder how much of my effort has been to bring a great theremin to the world, or perhaps whether what it was all really about was creating the theremin meant for me.

Time for bed - I think my meds must REALLY have kicked in! LOL.

Fred.

Posted: 5/18/2012 4:27:36 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

**REMOVED** I have removed this content for commercial reasons.If you are interested in obtaining this information, please email me - I am happy to help those genuinely interested, but not happy to be ripped off and taken for granted!

 I will not be visiting or contributing to TW much in 2013, and am unlikely to be replying to any threads.

Please feel free to contact me by email.

My email address is shown on my avatar.

it is:

fred

at

fundes

dot

co

dot

uk

 

Posted: 5/18/2012 5:03:59 AM
RS Theremin

From: 60 mi. N of San Diego CA

Joined: 2/15/2005

Fred said: A lot of mystical things have been said about theremins - Oh, I dont buy any of it (LOL!) - ;0).. But one thing stuck - it was: "You dont find your theremin, it finds you"

My theremin journey began with a whisper that said:

"True beauty is hidden in simplicity"

I can not put into words how this whisper came about as some things simple are difficult to grasped.

I will study the use of the CD4046, such an ancient, simple and straight forward chip.

Fred, I wish you improvement in your health, live long and prosper as K-pax awaits us all. V

Christopher

Posted: 5/20/2012 12:36:56 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 haven't entirely thought this through, but won't the x8 PLL frequency multiplication make the difference frequency drift 8x worse? "

A good question, but the answer IMO is no - it wont make things worse..

The 8* frequency is exactly the original frequency, only multiplied - thinking in terms of SNR, amplifying a quantity by 8 results in 8* more noise and 8* more signal, SNR stays the same.

Fred.

Posted: 5/21/2012 2:13:18 PM
dewster

From: Northern NJ, USA

Joined: 2/17/2012

"The 8* frequency is exactly the original frequency, only multiplied - thinking in terms of SNR, amplifying a quantity by 8 results in 8* more noise and 8* more signal, SNR stays the same."

Just thinking out loud, but I wonder what the phase noise of the 4046 VCO is?  It's almost certainly much worse than that of an LC oscillator.  Not saying it's a show stopper for this application, but it could add significantly to the noise, making the SNR worse.

I'm really glad that I decided to put a frequency display on my digital Theremin early on in the development phase.  I can see (and somewhat hear) lots of phase noise when playing at lower frequencies.  I've been busy trying to reduce this with a variety of methods (differentiated phase dither, delta sigma modulation, etc.) but will probably end up with a variable LP filter with cutoff set by the operating point itself.  Setting the fixed LPF to ~85 Hz puts it right on the edge of acceptable for both response speed and audible LF phase noise. ~170 Hz gives good quick vibrato, but somewhat audible LF noise.  ~42 Hz kills vibrato.  Classic engineering tradeoff.

Using a continuous analog oscillator in the AFE would fix this in a second, but I'm trying to avoid that if at all possible.  If I can't do this (almost) all in the digital domain I'll probably go down with the ship.

The up side to LF phase noise is that the ear is fairly insensitive to huge pitch changes in the lowest registers.  The ~3 cents rule applies more to the middle and upper end of the ear's range.  So SNR can tend towards crap at the low end without audible consequence.  In terms of doing this numerically, that's a big plus, as the pitch numbers down there tend to be small and noisy.

Posted: 5/22/2012 1:10:45 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

Well, I am much relieved! - They let me out of hospital having examined me internaly top-tail (literaly), and taken multiple biopsies - I am feeling a bit rough for it, but I dont have bowel cancer! - So, they still dont know whats wrong with me, but at least its not that!

Thanks for the candles and incense Christopher! ;-) and for all the good wishes from those here.

Ok - back to buziness:

"Just thinking out loud, but I wonder what the phase noise of the 4046 VCO is?  It's almost certainly much worse than that of an LC oscillator.  Not saying it's a show stopper for this application, but it could add significantly to the noise, making the SNR worse."-Dewster

The only time I noticed phase noise (VCO noise, actually) was when I was running the HC4046 without a divisor (VCO->Phase comparator input) - and I only did this when checking the interface to the oscillator (SIG-IN).. It did worry me seeing this..

However, I discovered that as soon as I put divisors between VCO Out and Comparator In (and changed VCO and filter components proportionally to the divisor) the phase noise reduced - in fact, the phase noise seems to reduce by 6db per division.. As a result of this I ran my PLLs up as high as I could (Maximum HC4046 VCO frequency is 12MHz, so I set divisor to /32, and limited max VCO frq to 11MHz, this means I could have an input frequency up to about 350kHz) and this gave a phase noise reduction of about 30db.

ADDED -> (more correctly, the noise of the divided VCO frequency being fed back to the phase comparator had greatly reduced noise - there was still a lot of noise on the actual VCO output)

As I multiplied the frequency to as high as I could and then divided the VCO down to get the required frequency, noise was not a problem.. However, in the designs I present here, I have not done that - so these designs will have more phase noise than my prototypes had... Whether this will be a problem, I cannot say.

Easiest way to rectify the above, if it is a problem, is to put a couple more dividers between the VCO output and the dividers already shown - add another /4 on both the reference and variable oscillator VFO's.

Put 1/2 74HC4520 in the VFO*16 line configured as /4 (->Clk  Q1->) and the other 1/2 in REF*16 line configured as /4 (->Clk  Q1->) .. The Q1 outputs driving the CLK inputs of the HC4520's already there.

Alternatively, replace the 4520's with 4040's and tap the apropriate outputs - this would also simplify division on the "register switching" design.

However, I suspect that the above 'trick' only works for analogue PLL's, as it is a direct function of the switching errors of the VCO - by operating the VCO at a higher frequency than one "needs" and then dividing this frequency down to what one actually needs, one seems to reduce the phase errors - for example, multipying the frequency by 32 (VCO = 32* Fin) and then dividing the VCO by 4, one gets the same frequency as if one had multiplied Fin by 8 - But the phase noise is reduced by 18db.

What I say above may have errors - all I know is that it works and reduces the phase noise to a level where I do not notice it and have difficulty measuring it - it may not be 6db / division, I only measured that roughly when I did /2, it became difficult to measure with greater divisors.

Fred.

(Ps - I did not show this extra multiplication on my notes or in my register-switching theremin notes, simply because I wanted to keep things simple - but adding the extra multiplication is likely to improve performance)

 

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