[sdiy] Really Low, LFO
Tom Wiltshire
tom at electricdruid.net
Sat Apr 3 12:20:55 CEST 2010
On 3 Apr 2010, at 02:10, cheater cheater wrote:
> Tom,
>
>> I agree with what others have said, it isn't hard to do *low*
>> frequencies with digital.
>
> Well... depends on the waveshape. A sinewave is not trivial to get
> going: either you need to have a *huge* table of values (not going to
> happen) or need a good interpolator, or need an algorithmic way of
> deriving the sinewave.
For a sine wave specifically you can use a quarterwave table and take
advantage of the symmetry. That increases the apparent size of the
table by a factor of four straight off the bat.
A 'good' interpolator would be nice, but even linear interpolation is
fine for sub-audio. It's not like the 'vocal' part of the audio range
where the ear is very sensitive. Instead we're talking about things
you *can't* hear. Consequently, you could set up an arbitrary
waveshape of 256 (1024, 2048, you choose) points and linearly
interpolate between them and no-one will ever know the difference.
> But given the very low sampling rate that you
> can get away with (you only need 2x freq of LFO... so not a lot!), you
> can make those algorithms as good as you want.
Yes, that's it exactly. We've got *ages* between samples, so we can
do whatever calculations we like! Maybe we *could* even do a full-
blown FIR filter interpolation on a PIC given the time we've got
available - nuts, but probably possible.
> The problem is that
> it's fairly boring math that, chances are, you won't use anywhere else
> in life - this is coming from a mathematician who normally finds
> boring stuff fascinating - so, if someone just wants an lfo with basic
> shape, I strongly suggest not reinventing the wheel and having a
> *good* look at specialized function generators
There are much better ways of reducing the frequency of my LFO, but
that was why I suggested slashing a factor of 256 out of the sample
rate. It involves changing about one line of code and it's done. If
you filtered the resulting 76Hz PWM output at somewhere down below
1Hz, you'd have a truly infrasonic LFO without any serious work or
expensive capacitors/op-amps.
Regards,
Tom
More information about the Synth-diy
mailing list