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

ADAU17xx Sigma DSP Readback cell inconsistent read with MicroController

SigmaDSP & SigmaStudio vnadon_B_ING Apr 28, 2015 00:00 13 replies Original on forum ↗
Subscribe
vnadon_B_ING Question
Apr 28, 2015 00:00

Hi,

I can read a fixed DC source value (positive and negative) with my MicroController by using a DSP readback block. I can also read a sinus output in the MicroController using the DSP readback. BUT, once I connect a microphone signal which is amplified (hardware and software gain) the value I read with my Microcontroller is quite saturated, which is not the case when I look at the value in Sigma Studio.

Could it be something related to writing the registers for the gains in the Microcontroller or the Readback has buffer problems? or...?

Thanks for your help!

adau17xx

micro controller

dsp_readback

SigmaDSP

ADIApproved Reply
Apr 28, 2015 00:00

HI Vincent:

Could it be that you are saturating the input? When you saturate the input, the additional headroom that the DSP provides doesn't fix the saturation, it will simply gain it. The ADC saturation point is 0dB FS.

Miguel

vnadon_B_ING Reply
Apr 28, 2015 00:00

I already verified and I am not saturating the input when I look in SigmaStudio.

vnadon_B_ING Reply
Apr 28, 2015 00:00

Now I decreased my gain and the value is no longer saturating in my MicroController. Why do I need 2 different gains, 1 for SigmaStudio and 1 for the MicroControlller?...

ADIApproved Reply
Apr 28, 2015 00:00

Hi Vincent:

I'm glad to found out more information about the problem I wouldn't know why you would have to gain down the read value from the micro controller. My guess is that your words are either not long enough to represent the value read back from the DSP OR you have a word alignment problem between the memory read and the place where it writes it to inside your uC.

Miguel

vnadon_B_ING Reply
Apr 29, 2015 00:00

I would be surprised that it would be a Byte array misalignment since I verified with a fixed DC source of -3.5 and after that with a Sinus tone and both were read correctly in the uC using the DSP readback (both signals didn't have any gain). I am quite sure the Sinus tone uses the full buffer range since it has positive and negative values (MSB changing) and very small numbers (LSB changing). I think it is more related to something like the Exported SigmaStudio files contain wrong information on slider positions in Hardware Configuration ( Record input Signal path Gain...) or something.

DaveThib Reply
May 1, 2015 00:00

Hello Vincent,

This could be an I2S or TDM format issue where the data bits are shifted left by one. This would be fine until you get louder than -6dBFS. Then you will clip the uC.

Have a look at that and take some screenshots if possible.

Look at your 1-bit delay settings if your serial ports.

Thanks,

Dave T

vnadon_B_ING Reply
May 5, 2015 00:00

I don't use I2S, I only use I2C to communicate from chip to chip.

I don't understand how the TDM (yes I use the TDM 8) would affect the DSP readback value? since the readback is not a digital output, but simply a DSP register that I read from the uC (see screenshot)

Also what is the 1-bit delay setting? is it the one I circled in the attached screenshot? What does this setting change?

1d8c668e26eab755cfdbe2f5c5937fe5.png
1d8c668e26eab755cfdbe2f5c5937fe5.png
1d8c668e26eab755cfdbe2f5c5937fe5.png-573x417.png
1d8c668e26eab755cfdbe2f5c5937fe5.png-573x417.png
f0f321a822a35a9386420f9fffa8d798.png
f0f321a822a35a9386420f9fffa8d798.png
f0f321a822a35a9386420f9fffa8d798.png-620x170.png
f0f321a822a35a9386420f9fffa8d798.png-620x170.png
DaveThib Reply
May 6, 2015 00:00

Hello Vincent,

I am a little confused as to what you are trying to do. So I will start by answering your question about the delay. This is for delaying the position of the serial audio data relative to the start of the frame. (LRCLK). For MSB first then the MSB will either be transmitted right on the edge of the Frame transition or you can delay it by one bit-clock cycle. I2S standard for stereo data has a one BCLK cycle delay. So that is what that setting is for. It sets up the desired serial format.

You see I was thinking that you are looking at the audio data coming out of the DSP and had level differences. Then being off by one bit will either lower your level by 6dB or horribly clip it. However, you are trying to read audio data using the read-back function. There is where you are running into level issues. The read-back is not updated constantly, I am not sure how fast the data is available in the register but even if it is at the audio sample rate you cannot read it out of the I2C port that fast. So your "sample rate" of this read-back is quite low. You will randomly pickup values of the sine wave at a particular instant. When reading DC values this works because it is not changing quickly but with a sine wave it will be quite by chance to get the value at the top or bottom of the waveform. Then you will also be missing many peaks due to the frequency of the audio signal. You will not be able to sample any audio faster than the Nyquist frequency of the I2C reads. Even then the level error when you are close to the Nyquist can be rather high. So how fast are you reading the I2C data?

So let's take a step back and find out what you are trying to accomplish? Give us some more detail about your application and things like audio sample rate etc.

Thanks,

Dave T

vnadon_B_ING Reply
May 7, 2015 00:00

Hi Dave,

Thanks for your very detailed reply.

Indeed I did consider the I2C DSP readback speed since the beginning. I am aware of all this. I am reading every 75 or 100ms now. So sampling frequency is something like 1/100ms = 10Hz which should be fine for what I do since I am only interested in the averaged level and not trying to record the Audio ...

What I don't understand is that when I sample the values of a sine wave, the values stay within the range of the sine wave so -1 to +1. When I sample my processed microphone (very complex algorithm), the levels are completely off (very high) and when I lower my gain the values are more within an acceptable range but still fluctuate way too much.

I will try to use a different way to measure the level, using RTA or non RTA (?) level detectors with the DSP readback. I would like to simply measure the level output of the detector with the DSP readback.

Thanks!

vnadon_B_ING Reply
May 7, 2015 00:00

I have tried the RTA to output as mentionned in this post : ADAU1701 have level data feedback to MCU?

but the what I read on the output pin with the DSP readback is still the audio signal and not the "level" as displayed on the RTA level detector...

How I can read the level on the Level Detector with the uC?

vnadon_B_ING Reply
May 8, 2015 00:00

I have found one source of problem by stripping down my algorithm down. I have figured out that when I put 2 feedback loops in my main DSP schematic it causes some problems when I transfer my algorithm to the uC. When I work the PC and SigmaStudio everything is fine, but as soon as I put my code in the uC with these two feedback loops my output level is changed (which shouldn't happen).

20log(0.16) + 30 = ~ 14 , I put an offset of 30dB...

But when programmed in the uC with the two feedback loops I read 9.61dB...

I think I may need to put one of the feedback loops in an hierarchy block, this might solve the problem? but why can't I have two feedback loops in the same main program?

87c253cda56e9ed49fd02c4f64d105f2.png
87c253cda56e9ed49fd02c4f64d105f2.png
87c253cda56e9ed49fd02c4f64d105f2.png-566x248.png
87c253cda56e9ed49fd02c4f64d105f2.png-566x248.png
893e52214940f028566d015bc9cbb6b1.png
893e52214940f028566d015bc9cbb6b1.png
893e52214940f028566d015bc9cbb6b1.png-132x92.png
893e52214940f028566d015bc9cbb6b1.png-132x92.png
2a5e2f58043e8c57f01beddad1e4b07c.png
2a5e2f58043e8c57f01beddad1e4b07c.png
2a5e2f58043e8c57f01beddad1e4b07c.png-271x267.png
2a5e2f58043e8c57f01beddad1e4b07c.png-271x267.png
vnadon_B_ING Reply
May 8, 2015 00:00

After putting part of the algorithm containing one of the feedback loops in a Hierarchy board, I now have 0 at my output... which is even worse...

I don't understand how this is possible. Again in my SigmaStudio everything is working fine, but not in the uC?

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin