[sdiy] Fast envelope follower circuit needed..
Richie Burnett
rburnett at richieburnett.co.uk
Fri Mar 29 15:32:10 CET 2013
I agree with you Tom.
I'd be more concerned about the discrete sampling process not actually catching the peak value of a high-frequency signal than I would be about aliasing in the intermediate processing that follows. Remember, Nyquist's rule that you have to sample at at least twice the bandwidth of the signal only guarantees that you can reconstruct the original signal. It's not sufficient to guarantee that you'll get a sample at the true peak or trough position on your waveform. Or even anywhere near them! Your two samples per audio cycle could in fact be near the zero-crossings! Therefore you need to oversample considerably or use other tricks like interpolation to find the true peak amplitude of sampled high-frequency signals.
A search on the subject of 'Inter-sample overs' discusses how signals with high-frequency content can peak higher than the discrete samples that represent the signal in the digital domain. This is of interest to anyone designing a digital peak-reading audio level meter for example.
-Richie,
Sent from my Sony Ericsson Xperia ray
Tom Wiltshire <tom at electricdruid.net> wrote:
>
>On 29 Mar 2013, at 09:06, cheater cheater <cheater00 at gmail.com> wrote:
>
>> Brian & Co.,
>>
>> On Fri, Mar 29, 2013 at 1:14 AM, <rsdio at sounds.wa.com> wrote:
>>> 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 or
>>> unsigned.
>>
>> why bother? The noise floor and inharmonic distortion introduced by
>> this process, done much more easily in an analog front-end, will be so
>> severe that the whole device will produce erroneous, un-musical
>> output.
>
>You made this claim previously, but I don't see the problem.
>
>It's true that doing rectification in the digital domain will introduce aliasing - but so what? Imagine we sample at 20KHz, and we've got a 440Hz sine wave coming in. We rectify and get a waveform that looks like a series of little hills and valleys at 880Hz. Those little valleys are sharp spikes that will cause aliasing.
>But why do I care? I'm not going to listen to the result. In fact, the only information I do care about is the height of those hills, and I haven't altered that at all. Once I derive the height of those peaks, I'm going throw that signal away. It won't ever see the light of analog day, and it certainly won't reach my ears, so I don't see how it can be "unmusical".
>
>As to "easier in an analog front end", a typical precision op-amp full wave rectifier requires two opamps plus a few resistors and diodes. It isn't complicated, but it's complicated enough that (as has already been mentioned) several commercial implementations use a simpler half-wave rectifier despite the drawbacks.
>Doing rectification in software is two instructions, or one if you've got a handy "abs" instruction. So, no, it's easier digitally. About the only argument I can see for doing it before the ADC is that it would provide protection against negative signals, which offsetting the input perhaps wouldn't.
>
>Tom
>
>
>
>_______________________________________________
>Synth-diy mailing list
>Synth-diy at dropmix.xs4all.nl
>http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
More information about the Synth-diy
mailing list