This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV320AIC3104: TLV320AIC3104: Amplitude rise on a codec loopback test (Part 2)

Part Number: TLV320AIC3104

Hello,

I open a related question to the thread with the same name (e2e.ti.com/.../942769 because I could not reply directly in the initial thread. 

In order to understand what I will explain and ask after, I suggest that you read the previous thread (the link is given above).

Following our previous discussion, we have changed the threshold for the tests we made in order to take into account the gain error impact on the Dout amplitude values measured.
However we have recently seen that even with this adjustment some of our equipments have an amplitude higher than the new threshold fixed.

My goal is now to find a way to put more controlled thresholds on the Dout value measured.

I have made some more tests where I send a sine wave at 1kHz and only change the Volume_In and Volume_Out parameters. The values measured are :
- The AC tension in the hard loopback
- The Dout amplitude value

The values measured on two equipments are given below :

Volume_In Volume_Out Digital Amplitude Dout1 Digital amplitude Dout2 Loopback tension 1 Loopback tension 2
25 80 2482 2593 46mV 48mV
40 80 9520 9928 65mV 65mV
45 80 14448 14897 68mV 67mV
50 80 21336 22203 73mV 74mV
60 80 45951 47696 80mV 80mV
75 80 65535 65535 87mV 87mV
100 80 65535 65535 94mV 95mV
25 100 7834 8179 80mV 81mV
100 100 65535 65535 180mV 185mV
75 75 65535 65535 78mV 77mV

As you can see, the AC tension is almost the same between the two equipments but there is a gap on the digital amplitude measured.

For example, for a Volume_In of 25 and a Volume_Out of 80, we have changed the threshold from 1980 < Dout < 2520 to 2100 < Dout < 2600. But on some equipments we recently measured a Dout value of 2680.
I know that we can change the thresholds again according to the biggest value we measure today but nothing can insure us that even with a new change we will not measure a higher value again.

According to the highest value of the ADC gain error (1.2dB mentioned on the previous thread), is there a way to define thresholds based on this value and on the AC value measured ?

Thank you again for your help.

Matteo

  • Hello Matteo,

    This is a bit tricky because as mentioned before, all devices are different. Moving forward, I have a couple of questions. 

    - What is the purpose of this threshold? I don't I quite understand why a threshold is being put on the ADC output. Is this just a volume thing?

    - If a specific output is desired, would the AGC be an option here? The AGC will keep the digital output at a constant level for a given input. 

    Regards,

    Aaron

  • Hello Aaron,

    Thank you for your reply.

    Unfortunately, I can not change either the design of the equipment tested (I can not use the AGC) or the way the test is performed on the codec.

    The only thing I can do here is to adjust the amplitude thresholds based on the error I could have because of the gain error.

    To answer to your question, the purpose of these thresholds is to insure that the amplitude measured is in adequation with the input send. So their role is to permit to detect a problem on the codec if the value measured is out of the limits. However, the drift we have seen recently is not caused by a real defect but by a variable gain error.

    So the tricky thing here for me is that I have to define new thresholds large enough to take into account the gain error but small enough to permit to detect a real defect. Indeed, I do not know if for an exepected output amplitude it is possible to define a maximal amplitude value based on a defined maximal gain error value.

    For example if I expect an amplitude of 2500 on Dout, is it correct to put 2000 < Amplitude < 3000 as thresholds or these two values are already too far from the expected value ?

    I hope my goal is clear for you even though I totally understand that all the elements I send could be confusing.

    Thank you so much for your help and patience.

    Matteo

  • Hello Matteo,

    I think I am starting to understand. I guess one thing to know here is if the signal level you are applying is constant or not. If constant, I believe it would make things much easier and we can assume a maximum gain error of -2dB for the ADC as this is well above the typical and we have seen GE as high as ~-1.5dB. 

    Regards,

    Aaron

  • Hi Aaron,

    Thank you again for your time and answer.

    For each test we made I can confirm that the signal we are applying has a fixed amplitude. The signal sent is a sine wave at a fixed defined amplitude and at either 400Hz or 700Hz or 1kHz.

    So according to this detail and if we assume as you said a maximum gain error of -2dB, do you know how can I define the thresholds for my tests ?
    Is there a forumula that permits to calculate my thresholds based on the assumed maximum gain error and on the expected Dout amplitude ?
    Or do we need more input parameters to define the thresholds ?

    Best Regards,

    Matteo

  • Hello Matteo,

    I believe I misspoke on the ADC gain error. I think absolute worst case would be +2dB of gain error and not -2dB. 

    I think to find an upper threshold, you need to find the max signal level and apply this +2dB of gain error. +2dB translates to ~1.259V/V of gain. So if your input signal is .5Vrms, then you would roughly see a .629Vrms at the ADC output (in codes of course). So ultimately, I think it comes down to what the max input signal level will be (in your case this is fixed) , add this +2dB of gain error and translate that to codes for the maximum output. 

    From our last exchange, I am not sure how the output data you sent over was calculating the output codes. If I can understand this, I am sure we can figure something out. 

    Regards,

    Aaron

  • Hello Aaron,

    Thank you for the explanation about the impact of the gain error on the Vrms amplitude.

    Here is the way we obtain the digital amplitude mentioned :

    • The defined sampling rate is 32000Hz
    • We analyse all the samples and we define a min and a max value for the amplitude.
      • These min and max values are signed 16 bits data. Also the maximal value we can read is 7FFFh (32767) and the minimal is -8000h (-32768).
    • We now calculate the Dout amplitude like this : amplitude = max - min ==> The Dout amplitude value is now an unsigned 16 bits value which has FFFFh (65535) as a maximal value.

    Thus, when I mentioned for example in our previous exchanges an amplitude of 10000 for Dout it means that the output of the ADC is in fact comprised between +/- 5000.

    However, the thing that I do not know is how the Vrms amplitude is transformed into a signed 16 bits data.

    I hope that the information I provide you are helpful for your understanding.

    Thanks again.

    Best Regards,

    Matteo

  • Hello Aaron,

    I would like to know if you have any update since my last reply ?

    Did the information I send to you are useful ?

    Thank you in advance for your reply.

    Best Regards,

    Matteo

  • Hello Matteo,

    Apologies for the long delay. 

    I think the following equation should help.. The equation (Vin-1.35V)*2^15 can be used to calculate the ideal output code for a given Vin. For example, if Vin = 1V, we can expect an ideal output code of -11468.8. 

    If you want to add some upper/lower limits, you can incorporate the min/max gain error. So for extremes, I would say +/- 2dB of gain error would be ok. For + 2dB of gain error, you can use the equation (Vin (1.259) - 1.35V) * 2^15  and for -2dB of gain error the equation (Vin (.794) - 1.35V) * 2^15.

     


    Regards,

    Aaron

  • Hello Aaron,

    No problem with the long delay and thank you for your answer it helps me a lot.

    I think I found the way to determine my thresholds amplitude values thanks to your equation. However I would like to share my methodology with you in order to be sure that the way I do the calculation is correct.

    First, I make the hypothesis of an exepected output value. For here I chose an output amplitude of 10000 (unsigned 16 bits) like I did in my previous answer. That means that the output of the ADC is comprised between +/-5000 (signed 16 bits).

    Secondly, I use your formula to determine the Vin for an output of +5000 (=> Vin = 1.50V) and the Vin for an output of -5000 (=> Vin = 1.197V).

    Now, for each Vin previously found, I can calculate the Vout(max) and Vout(min) by applying the formulas that take into account to the +/-2dB gain error : 

    - For Vin = 1.50V, Vout1(max) = 17552 and Vout1(min) = -5143

    - For Vin = 1.197V, Vout2(max) = 5162 and Vout2(min) = -13083

    And now, in order to switch back in unsigned 16 bits and having my final thresholds, I just have to substract the two Vout(max) previously calculated for the high threshold and the two Vout(min) for the low threshold.

    Thus Vout(max) = 17552-5162 = 12590 and Vout(min) = -5143 - (-13083) = 7940.

    Do you think that my explanation seems correct ?

    Thank you again.

    Best Regards,

    Matteo

  • Hello Matteo,

    I am not sure I am following the unsigned amplitude...  I don't understand why Vin (max) - Vin (min) = unsigned number but maybe this is just a gap in my knowledge of your system and data capture. 

    I think overall, the generating the upper and lower limits seems correct to me. 

    Regards,

    Aaron

  • Hello Aaron,

    The unsigned amplitude is the output value that we collect when we make our tests. 

    The calculation for obtaining this value is a part of the SW code of the DSP which communicate with the codec.

    For example if the sine wave we send has a digital amplitude comrised between +5000 and -5000, our system will define the value +5000 as the maximum value and the value -5000 as the minimum value. After that the next step is to make the operation : amplitude = max - min = 5000 - (-5000) = 10000. 

    The final amplitude is an unsigned 16 bits because if the max = 32768 and min = -32767 => amplitude = 32768 - (-32767) = 65535 which is the maximal value in unsigned 16 bits.

    The value we obtain is like an absolute value of the peak to peak amplitude of our signal. 

    I hope I was clear and that it permits you to understand better the unsigned thing in my previous reply.

    Thank you again for your help. I'm glad that I was able to define new thresholds thanks to your huge support.

    The calculation made with a +/-2dB gain error permits to have a good margin. I have also made the calculation by considering a gain error of +/-1.5dB and I found that the thresholds I obtain in this case are too close to the thresholds we currently have and that are problematic. Also I think that I have no choice of taking the hypothesis of a gain error of +/-2dB here (maybe I will try to calculate the thresholds with a gain error of +/-1.75dB just to see the values I obtain).

    Best Regards,

    Matteo

  • Hello Matteo, 

    Yes, this is clear now. Thank you for the explanation. 

    I hope the +/- 2dB threshold provides a good amount of room for error in your tests. 

    Regards,

    Aaron