My current project calls for a Peak Programme Meter - a peak-reading level meter with fast attack, slow decay and a logarithmic scale. My system microcontroller reads the level value periodically from the SigmaDSP (an ADAU1701), compares the value to a set of log-spaced thresholds and drives a row of LEDs.
In theory, the Sigma end of things should be easy - just use the Peak Envelope detector with an appropriate choice of hold and decay times. However, I have fallen foul of the fact that (as was flagged up here: http://ez.analog.com/message/50275#50275) the Envelope detectors have a linear decay characteristic rather than the more usual RC/constant-dB response. The effect of this is that my logarithmic meter decays ridiculously slowly at the top end of the scale and much faster at the bottom.
Two questions therefore spring to mind:
1. In the thread mentioned above, AD indicated that there might be a possibility of constant-dB version of the envelope detectors - is there any chance that these might arrive quickly enough to save me?
2. As that seems unlikely, can anyone suggest an alternative method of building a peak detector with fast attack and slow, constant-dB decay?
Any suggestions would be much appreciated.
Further to my earlier posting, I just tried out the scheme using a Peak Envelope External Decay with feedback and - much to my surprise - it worked perfectly!
There is an element of "suck it and see"…
I was about to suggest the same thing, including the small fixed offset. You beat me to it, but nice to see my approach validated. Have used this technique to get RC release in an AGC application. I think…
The following provides an exponential decay which is linear (constant) in dB. The graphs compare it with PeakEnv1
Thanks so much for bringing up the Peak Envelope Detector's non-dB decay -- I've been using them all over and never noticed their linear decay until now.
For your present application, perhaps you can try the circuit below. It starts out with a peak detector that's fast both ways. The following stage produces a quick rise, exponential decay function using feedback around a low-pass filter. When the input envelope is higher than the output, the comparator puts 15.9V (as high as possible) into the filter to drive it upward until the output reaches the input. When the envelope goes away, the output goes down at a much slower rate:
I tried it with some disco-like music (with a beat) to see how it works:
The output shows the desirable exponential decay. This circuit is somewhat limited in ultimate attack rate, and a bit noisy at the low end (the output hunts around zero), but hopefully with a little work you can have something like it drive your display satisfactorily.