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

ADAU1761 LEVEL DETECTOR

SigmaDSP & SigmaStudio inventis Sep 13, 2010 00:00 5 replies Original on forum ↗
Subscribe
inventis Question
Sep 13, 2010 00:00

Hello,

I'd like to implement a Passthru Level detector and read the values from my uController.

with Sigmastudio I generated the CODEC_PARAM.H where I find the following defines

/* Module LEVELCH1 - Single Level Detector*/
#define MOD_LEVELCH1_COUNT 4
#define MOD_LEVELCH1_DEVICE "CODEC"
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001TCONST_ADDR 191
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001TCONST_FIXPT 0x00004EB0
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001TCONST_VALUE SIGMASTUDIOTYPE_FIXPOINT_CONVERT(0.00240140490349172)
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001TCONST_TYPE SIGMASTUDIOTYPE_FIXPOINT
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001HOLD_ADDR 192
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001HOLD_FIXPT 0x000001E0
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001HOLD_VALUE SIGMASTUDIOTYPE_INTEGER_CONVERT(480)
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001HOLD_TYPE SIGMASTUDIOTYPE_INTEGER
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001DECAY_ADDR 193
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001DECAY_FIXPT 0x0000071C
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001DECAY_VALUE SIGMASTUDIOTYPE_FIXPOINT_CONVERT(0.000217013888888889)
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001DECAY_TYPE SIGMASTUDIOTYPE_FIXPOINT
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001_ADDR 194
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001_VALUE SIGMASTUDIOTYPE_10_18_CONVERT(0)
#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001_TYPE SIGMASTUDIOTYPE_10_18

What is the address that I have to read ?

Audio Signal Processors

SigmaDSP Audio Processors

adau1761

ADIApproved Reply
Sep 14, 2010 00:00

Hi Stefano,

I've written a thread about this same topic here: Monitoring average and instantaneous signal levels

The trick is to not use the level detector cell, but instead use the "DSP Readback" cell.

Please let me know if anything is unclear.

inventis Reply
Sep 14, 2010 00:00

Dear BrettG,

thanks for your answer.

I found the way to read the value from the level detector, explained below.

You suggest me a different approach to the problem.

In you opinion, are there any problem using the level detect block?

using the evalboard to sniffing the I2C communication I saw that the readback address

for the level detector is the last one in the module LEVEL DETECTOR define block.

For instance in the previous post i used a "Single Level Detector" and the readback address to use

to read the 4 bytes is:

#define MOD_LEVELCH1_ALG0_SINBANLEVDETS2001_ADDR 194

In a similar way I test the Pass thru Level detector and the readback address is always the last one in the

define block.

inventis Reply
Sep 14, 2010 00:00

Ok,

Thanks for the answer. I'll modify my project as you suggest me!

Last question.

I saw in your example that the numeric format is 5.19. The bits are right bit alligned, do you confirm?

ADIApproved Reply
Sep 14, 2010 00:00

Hi Stefano,

There are a few disadvantages to using the level detector cell when compared to the relative advantages of the DSP readback cell.

(1) The level detector cell is very resource-intensive and it uses more program instructions than the DSP readback cell.

(2) The detection scheme in the level detector is fixed. With the DSP readback cell, you have the flexibility to implement peak, RMS, MS, or whatever kind of detection you want from the blocks available in the SigmaStudio library. Hold, decay, and time constants are also flexible with the DSP readback cell, whereas they are fixed in the level detector cell.

(3) The DSP readback cell can also read back sample-accurate signal levels with no peak/rms/hold/decay, which would give you the true, instantaneous level of the signal in the core. The level detector cannot do this.

(4) Using filters with the DSP readback cell, you can bandlimit or shape the detection signal. In the level detector cells, your options are more limited.

So, there's nothing fundamentally wrong with using the level detector cell, but since it was created for quick, visual debugging and not production system use, it's not very flexible. The DSP readback cell will get you the same or better results.

ADIApproved Reply
Sep 14, 2010 00:00

That is actually a hardware limitation of the ADAU1701, which only has 24 bits in its read-back register.

Since you're using the ADAU1761, which does not have this limitation, you can read back the full 28 bits.

A more detailed description is here:

What are the number formats for SigmaDSP?