[sdiy] Fast envelope follower circuit needed..
dlmanley at sonic.net
Fri Mar 29 01:43:19 CET 2013
You could also discard all negative samples (half wave). The output goes thru LPF smoothing anyway, why bother with full wave?
-------- Original Message --------
From: rsdio at sounds.wa.com
Sent: Thu, Mar 28, 2013 05:14 PM
To: Synth-Diy List <Synth-diy at synth-diy.org>
Subject: Re: [sdiy] Fast envelope follower circuit needed..
>On Mar 28, 2013, at 11:24, Tom Wiltshire wrote:
>> Hi Dan,
>> On 28 Mar 2013, at 13:55, Dan Snazelle <subjectivity at hotmail.com>
>>> Though i work with c//arduino/AVRS not pics, this sounds very
>>> appealing! Can anyone recommend a place to learn about writing C
>>> code for an envelope follower? How do you do it? Shift signal to
>>> 0-5, then......
>> The first thing after that would be to do the full wave
>> rectification. Either dump the sign bit, if you've got signed data,
>> or invert the data if the highest bit is clear if it's not signed -
>> same thing, different representation. Half-wave rectification just
>> makes the signal more "lumpy" and isn't significantly easier
>> digitally anyway.
>You can't dump the sign bit, at least not with twos-complement data,
>which is what all digital signed data is. Maybe you're thinking of
>conceptually dumping the negative symbol, but that's not the same as
>dumping the sign bit. If you were to dump the sign bit, then the
>negative part of the signal would not be inverted, as needed, but
>would merely be shifted up into the positive range. That would make
>an ugly, spiked signal that would introduce significant errors in
>The easiest thing to do with signed data is use abs() to get the
>absolute value. Many 8-bit processors even have a native opcode to
>compute abs(), but they're not merely masking out the sign bit as
>would be done by and'ing with 0x7F.
>You are correct that inverting the data below the midpoint will work
>with unsigned data.
>You can probably use almost exactly the same code for either signed
>Synth-diy mailing list
>Synth-diy at synth-diy.org
More information about the Synth-diy