[sdiy] DIY digital VCOs?
Magnus Danielson
cfmd at bredband.net
Fri Jan 16 19:26:16 CET 2004
From: denshi <denshiblocks at yahoo.com>
Subject: [sdiy] DIY digital VCOs?
Date: Fri, 16 Jan 2004 01:48:23 -0800 (PST)
Message-ID: <20040116094823.75827.qmail at web20209.mail.yahoo.com>
Hi Seth,
> my brother is without internet connection, but wanted
> me to ask if there are any simple designs for DIY
> digital VCOs, he was particularly interested in basic
> stamp, or a solution like that. two octave range at
> least. thanks all!
Well, a digital VCO is often called Numerically Controlled Oscillator (NCO).
You do this by something called a phase accumulator. Let's assume that we
perform some operation cyclicly somehow (timer-triggered, just looped or
whatever) and for a single oscillator you have a control-value which we call
f (for some obscure reason ;O) and a variable which we call p (for another
obscure reason soon to be apparent) then we do this little operation on each
timer event:
p = p + f
Now, when we do this over and over p will increase as it accumulates f.
Eventually will p overflow and go down to just above zero. Now, interestingly
enought will the frequency of this overflow be linearly dependent on the
value f, so f will control the frequency of this oscillator and p will hold the
phase of the oscillator. It acts exactly as a sawtooth oscillator in the analog
world. Waveshaping can be done by very easy digital methods to create about
every waveshape you like.
If the update (sampling) frequency is fs and the phase-accumulator has N bits,
then will the output frequency fout become
-N
f = f * f * 2
out s
Inversly, the f value you want for a certain output frequency becomes
f
out N
f = ---- * 2
f
s
If you want only a part of the phase for some waveshaping, use the top bits of
your choice.
Anyway, as you see this is really trivial in both implementation (CPU, DSP,
FPGA, whatever) and in theory (above two formulas). Now, with this little
thinge you can do alot and PIC, AVR or BasicStamp will do just fine as long as
you can ensure that the "samples" is times with equally distance.
Now, with this at hand, your imagination will be your limit - really.
Cheers,
Magnus
More information about the Synth-diy
mailing list