ΣSigmaStudio Ask AI Русский Log in

Best way to implement a dbu meter using 6 LED's

SigmaDSP & SigmaStudio MichaelAF May 31, 2017 00:00 5 replies Original on forum ↗
Subscribe
MichaelAF Question
May 31, 2017 00:00

Hi All,

I am trying to implement a dbu meter and have 6 LED's setup to do so... would like to do -24, -18, -12, -6, -3 and 0db light up accordingly. I have tried using the RMS limiter to do this and I can get the LED to come on but the calibration is way off.. 0db coming in has to have -5db in the RMS limiter to make it work.

I put in a signal detect bar in to measure the level coming in and if I send -10db it is showing -10db so all that seems to be working correctly.

I have also put in dc blocking filter in to remedy any issues caused by things along those lines.

Open to all suggestions.

Thanks,,

Mick

KJBob Reply
Jun 5, 2017 00:00

Hello Michael,

Perhaps the most straightforward LED level display is made with this method:

First, convert the incoming audio to a slowly changing "DC" level with an envelope detector

Then use ABCD comparators to drive the GPIOs and light the LEDs,

A peak detector clearly defines "0 dB" as the clipping point, so I used a peak envelope detector. The feedback loop provides an exponential (dB-linear) decay; otherwise the linear decay of a standard detector appears strange on a LED bargraph set up for dB. You can calibrate the meter as desired simply by changing the values in each DC source setting the threshold for each comparator. I show three GPIOs because that's how many LEDs are available on a ADAU1701MINIZ evaluation board. Of course you can easily add more.

Wires going to ABCD comparators become sloppy very quickly, so I used net names (called aliases in SigmaStudio) to make these connections. To make an alias, right-click any input or output. You can ctrl-drag to duplicate an input alias.

Best regards,

Bob

c10cb823d1d4e21d0259ad58cd193176.png
c10cb823d1d4e21d0259ad58cd193176.png
c10cb823d1d4e21d0259ad58cd193176.png-620x325.png
c10cb823d1d4e21d0259ad58cd193176.png-620x325.png
MichaelAF Reply
Jun 5, 2017 00:00

Thanks for your response Bob!

Last night I got around the calibration issues with the RMS limiter by adding a linear gain with a value of 2... it tuned that right up so that kinda worked but I am going to give your solution a try as it seems like it should function more as a traditional VU meter.

Side question.. are there some good books or more detailed websites or tutorials where I can get more 'training' as it were with SigmaStudio and the ADAU1701 chip in my particular case?

Thanks in advance!

KJBob Reply
Jun 6, 2017 00:00

Hello Michael,

Likely you already know of the SigmaStudio wiki:

SigmaStudio and SigmaDSP Documentation [Analog Devices Wiki]

Though not perfect it lets us know how to use the processing blocks and features.

If you're new to DSP generally, this book is the best introduction I know of:

The Scientist & Engineer's Guide to Digital Signal Processing, 1999 | Education | Analog Devices

Of course you need not know DSP theory to build SigmaDSP projects, but I've found that the background imparted here has helped tremendously. This book taught me essentially what little I know about DSP.

As you can see by now, unfortunately there's no one-stop SigmaDSP resource. Depending on your needs at the moment, you might use something from the wiki, the ADAU1701 data sheet, EngineerZone, or the book mentioned above. And there's no substitute for just spending some time with SigmaStudio, learning its features and quirks. Here's a few tips:

Understand the fixed-point number formats, see What are the number formats for SigmaDSP?

Experiment with an unfamiliar block by building a simple project to exercise it. See if it does what you want.

The DSP Readback and Real-Time Display blocks make slow-moving signals accessible for troubleshooting

When reading back integers (28.0 format), multiply the signal by 4 twice (x16) before the DSP Readback. This is needed because the ADAU1701's readback register truncates the last four bits.

To see a fast-moving internal signal, connect it to a spare DAC to scope it. This works down to DC (with offset).

When building a huge project, be an artist. Sloppy projects are hard to understand and troubleshoot.

You can build some really neat "analog" functions in SigmaDSP. Some examples:

PLL tone decoding, FM and synchronous AM detection

Frequency-selective sidechain compressors

Compute an approximate value for pi

Voice-over ducker

Noise gates (even multiband ones approaching dynamic noise reduction)

Basic audio impedance and distortion analyzers

A voice stress analyzer "lie detector" (just for fun of course)

Generating sci-fi sounds, like flying saucers or the "voice" of a Parasaurolophus

Guitar effects

If you think of a fascinating idea, no matter how frivolous, try to make it! What you learn will immensely help when doing more productive stuff.

Where things get a little tough, search EZ for help. This is especially necessary, for example, when interfacing a uC to a -1701 to perform runtime user controls for EQ, etc.

Above all, have fun!

Best regards,

Bob

MichaelAF Reply
Jun 9, 2017 00:00

Thanks Bob for the suggestions!

Quick question... what is the formula you used to calculate the 0, -6 and -18 DC Input block values... I've tried to figure that out and so far I'm not having any luck at all.

Thanks in advance!

DaveThib Reply
Jun 9, 2017 00:00

Hello Mike,

Read this post: https://ez.analog.com/message/305239?commentID=305239#comment-305239

I just put up the external LED array cell for the 1701. This may be useful for you. The smallest is 8 LEDs but you do not have to use all of them and since it is driven by a table you can plug in the values that work for 6 LEDs.

Dave T