Designing VCO
Overview
In this section, I’ll explain the design of the VCO (Voltage Controlled Oscillator) in synthesizer hardware. VCO basically is a wave generator. Overview of the synthesizer hardware is explained below.
Digital Synthesizer Hardware Design
Wave generation
Figure 2 shows various wave types which can be generated by this VCO.
There are 3 different types of waves:
- Square wave
- Saw wave
- Triangle wave
VCO will generate those waves from calculation. So the formula for all those 3 waves are needed.
The easiest one is square wave. The output will be:
- Vm when t < 1/2 T
- -Vm when t ≥ 1/2 T
Second one is saw wave. This is also simple. This is just linear in a cycle, and start over again in next cycle. Formula is calculated like below.
(Vm - (-Vm)) / T * t - Vm = 2Vm/T * t - Vm
Third one is a bit tricky, since there are 2 linear functions, and switch between those 2. First half can be calculated like below.
((Vm - (-Vm)) / (T/2)) * t - Vm = 4Vm/T * t - Vm
For the latter part, gradient will be same but negative, and the constant will be different. Output changes 2Vm in T/2. That means, when t = 0, it must start from Vm + 2Vm = 3Vm. So the latter part can be calculated like below.
-4Vm/T * t + 3Vm
Wave continuity
Output frequency might change during playing the note, for example, pitch bend, and vibrato (modulation). When frequency changes, the wave should be continuous, otherwise, the sound would have noise every time frequency changes. To make the output continuous, use phase instead of time t directly. The block diagram of designed VCO is shown in figure 3.
The key is the phase generator. Phase generator is just a counter. It counts up until 2π, in T sec, then reset to 0. T will be calculated from input frequency, and it can change any time. For example, in figure 3, frequency changes twice. At first, the cycle was T1, and it’s changed to T2 in the middle. Then T3 at the end. The most important thing is, phase is always continuous. Also, amplitude does not change with frequency. It’s always constant. So the wave calculation would be changed like below with the phase input r.
Square wave
- v(r) = Vm (r < π)
- v(r) = -Vm (r ≥ π)
Saw wave
- v(r) = 2*Vm/2π * r - Vm
Triangle wave
- v(r) = 4*Vm/2π * r - Vm(r < π)
- v(r) = -4*Vm/2π * r + 3*Vm (R ≥ π)
Also, for the calculation, we can map 2π to any integer number. In my case, I mapped it to 2²⁴. Also, if Vm = π (2²⁴), calculation becomes much easier.
That’s how VCO generates various wave form.