[sdiy] Fast envelope follower circuit needed..

Tom Wiltshire tom at electricdruid.net
Fri Mar 29 01:39:12 CET 2013


On 29 Mar 2013, at 00:14, rsdio at sounds.wa.com wrote:

> 
> 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> wrote:
>>> 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 your envelope.

No, you're quite right. My mistake. You need to invert the byte if the sign bit is set, otherwise as you say, the negative part is just shifted up, rather than flipped over.

In my defence, I've actually been working on a random generator algorithm the last few days which *does* just dump the sign bit to produce noise in the output range 0-5V rather than -5 to +5V. Since it's noise it doesn't matter. Hence the confusion.

T.




More information about the Synth-diy mailing list