Level Detectors, Absolute Value, Peak and RMS

Where we discuss new analog design ideas for Pro Audio and modern spins on vintage ones.
tubegeek
Posts: 25
Joined: Mon Mar 18, 2013 12:36 pm
Location: Brooklyn NY

Re: Level Detectors, Absolute Value, Peak and RMS

Post by tubegeek » Wed Mar 27, 2013 11:25 pm

Likely, I'm missing something, but -

Isn't the behavior of the peak of the wave a whole lot more important than the zero-crossing behavior for level indicator application? What does distortion of the rectified wave even matter here? Wayne: are you looking at that output behavior so critically because you have another purpose like a compressor level detector or something?

Reading/digesting the recommended sources - I'm a big fan of Rod Elliott's site already, it was good to see the ESP logo pop up when I clicked, thanks very much!

-j

User avatar
mediatechnology
Posts: 2706
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: Level Detectors, Absolute Value, Peak and RMS

Post by mediatechnology » Thu Mar 28, 2013 4:39 am

Likely, I'm missing something, but

Isn't the behavior of the peak of the wave a whole lot more important than the zero-crossing behavior for level indicator application? What does distortion of the rectified wave even matter here? Wayne: are you looking at that output behavior so critically because you have another purpose like a compressor level detector or something?-
Good catch.
Yes, there is another purpose.
In most cases the accuracy of the peak level is the most important attribute.
In my application I want smooth, not hard corners, in the transition region.
"There does seem to be a pattern where, the more difficult a truth is to stomach, the higher the hysteria levels go internally at Google."
Visit RockmoreLabs on Etsy https://www.etsy.com/shop/RockmoreLabs
http://www.ka-electronics.com

User avatar
JR.
Posts: 2059
Joined: Sat May 24, 2008 7:21 pm

Re: Level Detectors, Absolute Value, Peak and RMS

Post by JR. » Thu Mar 28, 2013 3:35 pm

You're missing the crux of the biscuit (at least of my biscuit)

Wayne's scope traces are for a couple volts of signal. As I have mentioned several times now the precision rectifier issue is a product of frequency and how low the level is.

That deviation from perfect rectification around the zero crossing becomes a much larger fraction of the waveform for very small signals.

Not a big issue for a peak meter of compressor side chain. for designing test equipment it's a huge deal.

JR

[edit- its a little like crossover distortion in a power amp... at high level the HF waveform looks clean. At low level it looks and sounds like crappo /edit

User avatar
mediatechnology
Posts: 2706
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: Level Detectors, Absolute Value, Peak and RMS

Post by mediatechnology » Thu Mar 28, 2013 3:58 pm

Wayne's scope traces are for a couple volts of signal
FWIW the first pic was a 10 mV (peak) 20 kHz photo.
I really should put a couple of trims on it and see where it bottoms out.
"There does seem to be a pattern where, the more difficult a truth is to stomach, the higher the hysteria levels go internally at Google."
Visit RockmoreLabs on Etsy https://www.etsy.com/shop/RockmoreLabs
http://www.ka-electronics.com

User avatar
JR.
Posts: 2059
Joined: Sat May 24, 2008 7:21 pm

Re: Level Detectors, Absolute Value, Peak and RMS

Post by JR. » Fri Mar 29, 2013 7:57 am

mediatechnology wrote:
Wayne's scope traces are for a couple volts of signal
FWIW the first pic was a 10 mV (peak) 20 kHz photo.
I really should put a couple of trims on it and see where it bottoms out.
Image

Yup, and you can already see how the top waveform is seeing the effect of inadequate loop gain.. Instead of sharp edges around the zero crossing they are rounded off and slewing slower. As the level drops lower it gets worse.

JR

User avatar
mediatechnology
Posts: 2706
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: Level Detectors, Absolute Value, Peak and RMS

Post by mediatechnology » Fri Mar 29, 2013 11:24 am

That's one of the reasons I've always favored current-boosted comparators for peak detectors.
"There does seem to be a pattern where, the more difficult a truth is to stomach, the higher the hysteria levels go internally at Google."
Visit RockmoreLabs on Etsy https://www.etsy.com/shop/RockmoreLabs
http://www.ka-electronics.com

User avatar
JR.
Posts: 2059
Joined: Sat May 24, 2008 7:21 pm

Re: Level Detectors, Absolute Value, Peak and RMS

Post by JR. » Fri Mar 29, 2013 11:40 am

mediatechnology wrote:That's one of the reasons I've always favored current-boosted comparators for peak detectors.
Yup, perhaps the reason I suggested a lm339... actual comparator designed to compare.

Accuracy of peak detection at -50 dBu is not a huge concern , try to FW rectify, take the average, then log, then convert to dB down low enough for noise measurments. But like I've probably already said recently, a couple dollar micro will do all this and more, easy peasy.

JR

User avatar
mediatechnology
Posts: 2706
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: Level Detectors, Absolute Value, Peak and RMS

Post by mediatechnology » Sat Mar 30, 2013 7:56 am

But like I've probably already said recently, a couple dollar micro will do all this and more, easy peasy.
What A/D sample rate and number of bits do you get for $2?
What sample rate and number of bits did you use in your prototype meter?
"There does seem to be a pattern where, the more difficult a truth is to stomach, the higher the hysteria levels go internally at Google."
Visit RockmoreLabs on Etsy https://www.etsy.com/shop/RockmoreLabs
http://www.ka-electronics.com

User avatar
JR.
Posts: 2059
Joined: Sat May 24, 2008 7:21 pm

Re: Level Detectors, Absolute Value, Peak and RMS

Post by JR. » Sat Mar 30, 2013 9:09 am

mediatechnology wrote:
But like I've probably already said recently, a couple dollar micro will do all this and more, easy peasy.
What A/D sample rate and number of bits do you get for $2?
I don't have the sample rate details off the top of my head...

The micro family I am familiar with offers multiple 12 bit A/D channels per $2 (and change depending on qty) , The physical part actually has 4x 10 bit A/Ds that can be configured as 4 parallel 10 bit convertors, or combined to make one 12 bit conversion. This one convertor has an input multiplex so you can selectively convert between 10 inputs or more (I don't recall exact upper limit).

The sample rate is programmable so you can make it arbitrarily fast, but the settling time for the internal SAR (Successive approximation register) will limit how fast you can convert inputs and get full bit resolution.
What sample rate and number of bits did you use in your prototype meter?
Actually the meter I did with APB went into a production console several years ago
http://apb-dynasonics.com/products/Prod ... oDesk.html
Image

The one micro was generating 4 meter outputs. The 12 bit A/D was multiplexed between 4 of 6 possible inputs, I handled the solo logic, for the meter in the micro too. When you multiplex between multiple inputs there is another accuracy vs timing constraint. The input sample and hold has an acquisition time also, so toggling between inputs too rapidly causes ghosting (on meters) or residual readings from the former signal being converted. On a meter this looks like crosstalk.

I don't recall the exactly where my sample rate ended up in the APB meter. IIRC I disregarded Nyquist/Shannon criteria of 2x 20kHz, since I observed allowing the signals to alias down below sampling rate, still gave usable meter results, with the possible exception of a fixed sine wave at exactly the sample rate, but IIRC I dithered the sample rate a little too so even that wouldn't happen. One strategy to work around the input S/H capture time, I would take something like 4 samples per input after changing inputs and average, or discard the first sample if it was inconsistent with others. I vaguely recall one software tweak after release to push up the serial communication rate to shift the tiny noise leaking in to the console noise floor up above 30 kHz.

Of course a console meter is much easier than test equipment. If I were revisiting my TS-1 using today's technology I would probably use one of the economy audio codecs doing 18 bit+ 20 Khz stereo for <$2 last time I looked. I could stick a DPOT in front of this to scale gain and pick up a few more bits of dynamic range.

But I have a rule against doing products that can be performed by an IPHONE app... Even though they are selling drum tuners these days in IPHONE apps, they don't work as good as mine. (while < 1/100th the price).

JR 8-)

User avatar
mediatechnology
Posts: 2706
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Re: Level Detectors, Absolute Value, Peak and RMS

Post by mediatechnology » Sat Mar 30, 2013 11:59 am

OK, I get the part about how conveniently the micro can scan and scale the display, provide ballistics etc.
It's a nice functional meter with a fairly low BOM and in it's application killer. Need to find the link to the vid you posted.
I suspect the LEDs are the greatest cost.
PICs eventually seem to enter most threads here.

But with a theoretical DR of 72 dB (for a 12 bit conversion) and with sub 40 kHz sampling I don't see how you can claim greater accuracy than a continuous time (analog) absolute value circuit costing pennies (5532 + 2X inexpensive dual transistors) that has at least 60 dB of usable range at 20 kHz. I may be wrong but I think that's what I heard.

Sampling 20 kHz only 1-1/2 times per waveform period the odds of actually hitting the peak value seem rather slim to me.
I get the averaging across samples part and understand how an 18 bit higher-speed converter would make it better.
But I'm not buying how a 10-12 bit aliased sampled input that's "blind" to the waveform more often that it isn't can be more accurate than a dual op amp and handful of diode-connected transistors. (Or for that matter just diodes.)

It seems that the HF accuracy limitations of the sampled approach exist at any level whereas the analog approach suffers it's greatest errors only at low levels.
What it looks like to me is that using a PIC allows you to do all this housekeeping and add a lot of functionality at low cost with reduced accuracy due to low sample rate.
Kinda like an iPad or iPhone-based drum tuner...
"There does seem to be a pattern where, the more difficult a truth is to stomach, the higher the hysteria levels go internally at Google."
Visit RockmoreLabs on Etsy https://www.etsy.com/shop/RockmoreLabs
http://www.ka-electronics.com

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests