[sdiy] lookup table as expo converter
Colin Hinz
asfi at eol.ca
Fri May 28 10:01:33 CEST 2004
On Tue, 25 May 2004, Ingo Debus wrote:
> Am Dienstag, 25.05.04 um 00:29 Uhr schrieb Tim Ressel:
>
> > Tim don't know compression. Tim just bang rocks
> > together and make wavetable.
>
> Here's an easy way how to do it with a small table:
> Take the ADC value, subtract the binary equivalent of 1 volt, do this
> as often as required to get into the range between 0 volts and 1 volt.
> Count how often you had to subtract, this gives you the octave you're
> in (assuming the input is 1volt/octave). Then use a table to decode the
> remainder. If you only need semitone resolution, this table has just 12
> entries. The octave gives you a multiplier, say 1 for lowest octave, 2
> for next octave, 4 for next octave and so on.
>
> I used a similar technique (just the other way around) in my
> pitch-to-MIDI converter.
Sounds like you've implemented the first stage of a SAR....!
(Semi)-seriously, imagine a mutant ADC with two accumulator registers:
one amasses the binary bits as usual, while the other one sums up
exponentially-weighted values. No lookup tables (except for maintaining
the expo-weighted values, which require 2^N storage words) and it's
as accurate as your mixed-signal interface. Yep, it means regressing
to non-monolithic SAR ADCs, but you can't have everything. At least
in this case, the required resolution and speed mean that weird
bleeding-edge performance enhancements are unnecessary.
And if you're wondering, yes, I *did* go to the Analog Devices
"Analog-Digital Conversion" seminar on Wednesday. 'Twas pretty good.
- Colin Hinz
Toronto, Canada
More information about the Synth-diy
mailing list