Wed Mar 2 12:33:07 EST 2011

Fuzzy class D multi channel amp

Problem 1: I want a multi-output class D amp for synth control
signals.  BW = 200Hz is a must, anything higher is welcome.

Problem 2: I want to use a cheap, off-the-shelf part (a PIC uC).

In general, you'd want to solve the problem in hardware (i.e. PLC or
FPGA) for one channel independently, and then duplicate it n times.

However, the rates involved in my problem are quite low, so it's
probably possible to use a cheaper uC-based solution.  How to go about
making that optimal?

To do it on a PIC requires some cleverness, as flipping multiple bits
at the exact calculated time will not work well because the PIC needs
to do the necessary computations serially.  

Taking a strict time multplexing approach is probably not optimal, as
in most cases no action needs to be taken, i.e. no toggle performed,
so we might as well not have done the computation in the first place.

So I wonder how to go about trying not to perform unnecessary work and
using a more optimal multiplexing scheme.  I.e. something like:

  - find a fast way to guess the next output that needs a toggle

  - verify the guess by performing a computation

  - perform the toggle (or not!)

  - record the actual time of the toggle so it can be incorporated in
    the next control computation

The hard problem seems to be the first one: how to build a system that
knows which current error is the largest, so requires immediate toggle
action?  If the guesses are accurate, there won't be many computations
that are for nothing, i.e. that decide to not toggle because it's too

I'd say this is a data structure problem.  Find a way to keep a sorted
list of current errors.  Then simply pick the top one to update.