Hey Don, have you ever played with generating PWM from arbitrary length
counters? i.e., instead of setting TOP = 4096 for 12 bit accuracy, vary TOP
and COMPARE so you get a ratio of two numbers instead of one fixed.
Especially if combined with dithering (maybe driven with Bresenham's
algorithm or delta-sigma), this will give higher accuracy for a given
bandwidth/clock rate. The central problem is finding the ratio, which is
simply the largest convergent (continued fraction) that fits in the
We originally started magic sinewaves with exhaustive searches, similar
to the above.
Turns out there are quite a few 384 bit words!
All sorts of weird and slow games eventually converged on our latest (
and near instant! ) calculators. And then Chrome made them even faster.
Curiously, I still have found no way to rapidly calculate plain old
Magic Sinewaves. Turns out there is some redundancy ( such as 8
equations in 6 unknowns ) that it is not obvious how to deal with.
The original ms calculations can still be done using the "series II"
portion of this ancient code...
"regular" magic sinewaves have the curious property that their first
unwanted harmonics are OPPOSITE IN SIGN and (nearly) comparable in
amplitude to BBE bridged best efficiency ones.
Sadly, all attempts at mixing them for cancellation to date have
worked but introduced cosine terms or subharmonics that mostly do
a lot more harm than good.
"Too good to be true" strikes again.
Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
email: [email protected]
Please visit my GURU's LAIR web site at http://www.tinaja.com