Design of a QRMS audio meter

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Well, speaking of DSP, I have been playing with the same idea for a long time.
Do you have any sources of sample code that can do this type of calculation in embedded system? I couldn’t find any.

I would look at the sample code for smart metering of power. Yes, this is only 50/60Hz, but the principles should be the same.

I'm ok on basic embedded programming, but DSP is so far not something I had to solve myself.

Thor
 
Excellent work. I would like to throw in a curve ball from the stands.

We nowadays get 8051 MCU's with 1Megasample / Sec 12 Bit ADC, multiple PWM Channels and 48MHz clock speed and improved core where most operations take one or two clock cycles, with generous RAM, ROM, on board USB for flash and debug, in a 48-pin case, for around 2 USD in small quantities.

MCU's build on 32-Bit ARM Cores cost a little more, but are otherwise similar.

This kind of MCU should allow a meter to be build that simply samples the music signal at (say) 100kS/sec and gives us a 72dB dynamic range with an LED Bar with at least 40 LED's (single colour, full RGB and more LED's is possible using SPI port extenders), that can display any metric (including multiple in parallel) from peak to RMS and average and including weighted frequency response all in software.

It would likely be much less expensive and offer more functional flexibility as a meter. We might (for) arguments sake) even include a numerical readout in LUFS and perhaps more numerical digits to capture the actual dynamic range and crest factor.

Thor
What an excellent point you've brought up, it's like the audio meter's paradise. Of course, I would love to get my hands on a device with all those features. But given my inability to do it on my own, I'm excited about a solution of seeing how far we can go with a simple analog circuit.
For your information, I've been studying how to identify an audio meter for years, and I even published a paper in the AES. You can check it out here: AES E-Library » Method to Evaluate the Ballistics of Audio Meters.
 
I had previously commented on this: "The problem is that the LM3914 is linear and not logarithmic. So, I am working on a design that somehow compensates for the logarithmic scale. What I have so far is quite close, but it has an error of more than 1dB. I will see if I can improve it."
Well, I've completed the project of designing a 30-LED meter with LM3914 to have a logarithmic response, and I hope to publish an article about it, next week. I hope it will be of your interest.
 
I had previously commented on this: "The problem is that the LM3914 is linear and not logarithmic. So, I am working on a design that somehow compensates for the logarithmic scale. What I have so far is quite close, but it has an error of more than 1dB. I will see if I can improve it."
Well, I've completed the project of designing a 30-LED meter with LM3914 to have a logarithmic response, and I hope to publish an article about it, next week. I hope it will be of your interest.
[I hope it will be of your interest] -- "Standing By....." with great interest!!! Be sure to include any updated schematics as well, OK???

[a 30-LED meter with LM3914 to have a logarithmic response] -- So.....your new circuit design uses an LM3914 device that has an LM3915 response to it? Do I understand that correctly? That's rather interesting!!!

Does your LED bargraph display use the typical GREEN/YELLOW/RED display, with the top 2 or 3 LED's being RED? Sounds cool!!!

CAN'T WAIT!!!

/
 
I would look at the sample code for smart metering of power. Yes, this is only 50/60Hz, but the principles should be the same.

Thor
Thor - Smart meter's usually calculate RMS "real" power by computing the instantaneous product of V and A. Since there is no current sample that code may not be too useful.
 
Thor - Smart meter's usually calculate RMS "real" power by computing the instantaneous product of V and A. Since there is no current sample that code may not be too useful.

Indeed, they first sample two wave forms and then sum them and calculate.

It will illustrate using the ADC to get a waveform sampled and how to calculate RMS. It's not "just change one line of code" level, but should take most of the hard work out of the design.

Thor
 
Several years ago, after THAT announced discontinuance of the 2252 RMS detector, I played around with replacements using THAT300 arrays.

https://proaudiodesignforum.com/forum/php/viewtopic.php?t=856
The interest was primarily for analog dynamics processing. The detectors range from simple to complex depending on dynamic range and speed.
Yes, for sure, I've been using the 2252 for years, and I even bought 100 of them at the time, of which I still have plenty. They are unbeatable. I've even found a way to modify the release time to make them symmetrical with a 400ms attack and a 400ms decay, using them in my sound level meters with good results! I've been thinking about replacing them with the 4305 ones.
 
I want to compliment you vmsa on your three excellent threads. "Logithmicizing" the LM3914 is brilliant and I follow with great interest the QRMS and K-filter.

I thought I would offer a suggestion for RMS detection using a THAT Design Brief sent to me by Roslafonso Bortoni not yet published which is similar to the original DN-119 "Wide Ranging dB Meter." The Design Brief suggests using a THAT4305 but since you're interested in a 5V solution the 5V THAT4316 could be used. A single 4316, along with an outboard level-shifting op amp, would provide all three functions of the QRMS and solve LM3914 "logification." The circuit below performs (1) Absolute value, (2) RMS and (3) linear dB scaling. It could also provide a large dynamic range probably more than you would actually need. Rosalfonso simulated the circuit and I built it for him using a 4315 and it easily, at 1 kHz, had a 100 dB DR. Though all of that DR may seem to be overkill and doesn't have to be used you can't beat the circuit for simplicity, low cost and 5V operation.

Here is the 4305 version. I did discover that to be equal to a THAT2252 Ct (C3) needs to be doubled to 22µF. The circuit is pretty self-explanatory if you've read DN-119 or see it as a 2:1 compressor. R5's purpose is not obvious and is critical to circuit operation as it provides a load for the VCA's internal output current mirror. On the 4316 the VCA and RMS outputs are biased to 2.5V and it would appear R5 would need to tie to the +2.5V bias pin.

THAT4305_Wide_Range_RMS_Detector.JPG

You could also use this circuit as a guide and take output from the RMS detector. The I-V op amp might be replaceable with a resistor as shown above.

4316-comp-r0.gif
 
Last edited:
I want to compliment you vmsa on your three excellent threads. "Logithmicizing" the LM3914 is brilliant and I follow with great interest the QRMS and K-filter.

I thought I would offer a suggestion for RMS detection using a THAT Design Brief sent to me by Roslafonso Bortoni not yet published which is similar to the original DN-119 "Wide Ranging dB Meter." The Design Brief suggests using a THAT4305 but since you're interested in a 5V solution the 5V THAT4316 could be used. A single 4316, along with an outboard level-shifting op amp, would provide all three functions of the QRMS and solve LM3914 "logification." The circuit below performs (1) Absolute value, (2) RMS and (3) linear dB scaling. It could also provide a large dynamic range probably more than you would actually need. Rosalfonso simulated the circuit and I built it for him using a 4315 and it easily, at 1 kHz, had a 100 dB DR. Though all of that DR may seem to be overkill and doesn't have to be used you can't beat the circuit for simplicity, low cost and 5V operation.

Here is the 4305 version. I did discover that to be equal to a THAT2252 Ct (C3) needs to be doubled to 22µF. The circuit is pretty self-explanatory if you've read DN-119 or see it as a 2:1 compressor. R5's purpose is not obvious and is critical to circuit operation as it provides a load for the VCA's internal output current mirror. On the 4316 the VCA and RMS outputs are biased to 2.5V and it would appear R5 would need to tie to the +2.5V bias pin.

View attachment 116424

You could also use this circuit as a guide and take output from the RMS detector. The I-V op amp might be replaceable with a resistor as shown above.

4316-comp-r0.gif
Thank you very, very much for your kind words. I'm glad that you find my designs interesting. Also, I appreciate your insights on the use of 4305 and 4316. Regarding the 2252, when I attempted to use it in loudness meters, that required a symmetric integration, (which THAT claims to be impossible to achieve), I designed an external discharge circuit, reducing the discharge time and making it symmetric with the charging time at 400ms.
So that you can appreciate what I was able to do with the 2252, I'm sharing my design for the stage required to control a display with LM3914.
Regards!
That2252 circuit.jpg
 
What about using TFT display rather than a bar graph?
It could show peak, peak-hold w/decay, rms, clipping, with a time axis like a scope.
Is making something complicated like the stochastic values in music optimal?
 
Nice little box of tricks ,
be nice if the VU meters could show gain reduction , like on a compressor ,

Would make a very cool modular synth waveform monitor ,

I wonder what the accuracy is like , can it be calibrated precisely to a known reference ?
 
https://www.aliexpress.us/item/3256...a57079&afSmartRedirect=y&gatewayAdapt=glo2usa
They also have one that is a little larger that does various things like this and also does spectrum analysis for not much more money.

If you do some AliExpress searching, or type it into a Google Image search with the word AliExpress added, you'll find a ton of stuff around the $20.00 range.

And AliExpress has 2.4" analog vu meters pre-built for under $10.00.

And there are a zillion Arudino-type circuits out there for this.

Weirdly enough, though I lived the majority of my life more in the analog era, I find I 100% prefer linear bar-graph style peak meters.

For me it's just a better quick subconscious visual reference/check that i don't get from analog VU meters.

AliExpress has a ton of those pre-built, both the (32? 30?)-segment, and for some reason the 12-segment is insanely cheap, while any other segment size, bigger or smaller is about 5x to 10x the price of those two.

I am actually using the free Avid Eucon Control app on an old discarded iPhone for metering, and with some tweaking it works great.

I'v heard of PC issues, but on a Mac it is completely solid, and no going into ip addresses or anythign for wifi, it just connects by itself without connecting at the start of the day.

I think it also does Android, but you would have to check.
 

Latest posts

Back
Top