[sdiy] VCO design question
Tom Wiltshire
tom at electricdruid.net
Thu Oct 2 22:34:37 CEST 2008
On 2 Dec 2008, at 20:16, Antti Huovilainen wrote:
> On Tue, 2 Dec 2008, Paul Maddox wrote:
>
>> I wouldn't say any idea was bad, just because it doesn't follow
>> the rules :-)
>
> For a valid comparison it has to have same quality and features as
> the analog solution though. Apples to apples and all that.
> Digital oscillator can do that, but it's no longer quite trivial.
>
> You can "pulse width" modulate most waveforms if you synthesize two
> copies of the integral of said waveform and adjust their phase
> difference (sawtooth is integral of pulse train).
Sorry, but I can't help myself but jump in here, even if is going
rather off topic. Poor David'll never get his answer...
I've recently done this ramp down/triangle/ramp up thing on a digital
osc. I didn't use the integral technnique that Antti mentions, but
instead used a simple piecewise linear phase distortion function. I
did it principally because I wanted the oscillator to have proper
PWM, but the "digital bonus" is that you can apply the effect to all
the other waveforms too, not just square waves.
It wasn't particularly difficult (around 15-20 instructions on a
dsPIC) but it isn't trivial. Even 20 instructions starts to add up
between samples.
The other problem is that "squashing" a triangle wave into a ramp
wave increases the harmonic content. This happens with any other wave
too, even a sine. So aliasing is an issue at higher frequencies. How
much of a problem obviously depends on the source waveform and
frequency, and the sampling frequency. I found that I needed to limit
PWM to the range 5%-95% to avoid the worst effects, but this is
subjective. Probably others would go to 2%-98%, or even revel in the
nasty crunchiness of it all.
T.
.
More information about the Synth-diy
mailing list