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.

Problem in speech signal processing with TLV320AIC23B

Other Parts Discussed in Thread: TLV320AIC23B

Hello,

I am using the platform 5509A DSK, TLV320AIC23B as the codec. I Selected LINEIN as the input and PHONEOUT as the output. Now, I use 16bits for TLV320AIC23B data word length and 32KHz for sampling rate. There is something not correct I think in the digital data read from the ADC. For illustrating the problem more clearly, I use the 1KHz sinewave as the input. The figures in the attachment is the result of the ADC I get and view in the CCS.
Illustration for the figures:

Figure1: Magatitude 140mV, 16bits signed sampled result


Figure2: Magatitude 140mV, 16bits unsigned sampled result


Figure3: Magatitude 150mV, 16bits signed sampled result


Figure4: Magatitude 150mV, 16bits unsigned sampled result


Figure5: Magatitude 750mV, 16bits signed sampled result


Figure6: Magatitude 750mV, 16bits unsigned sampled result



For every circumstances, the output from DAC is the right wave as input with no distortion. What I think is that if I use the 16bits word length for sampling, the range for the unsigned digital data should be 0~65535. But now, you see, is not that true. My problem is:

How does it come?And how can I solve this problem?

My configure is as follow:

McBSP as the data port of the TLV320AIC23B, single phase, one frame containing two data word, each 16bits.
I2C as the controling port of the TLV320AIC23B, 2-wire mode.
TLV320AIC23B word length 16bits, DSP mode.

I appreciate what you will do for me.

andi

l.

  • Andi,

    The AIC23(b) uses 16-bit signed int data format for the configuration you described. A full scale sine wave centered around 0V at the input ideally produces a digital output with a range of [-32768 to 32767].
    If you interpret this data as unsigned 16-bit int in CCS, each sample 'X' with 'X' < 0, will appear as 65535 - 'X'.

    Your plots look like the data is interpreted as unsigned 16-bit int in the first screen shot (and subsequent uneven screen shots) and signed 16-bit int in the second screen shot (and subsequent even screen shots). This is contrary to your plot labels. Please make 100% sure that the data is interpreted as signed 16-bit integers in your program.

    Your plots also show a shift to negative numbers. The first plot shows the sine wave completely below the max range of unsigned 16-bit int (65535). The second plot shows the same sine wave completely below 0 of signed 16-bit int. The reason for this shift is a voltage offset of approx. -70mV that either exists in the source signal or is introduced by the AIC23(b) (which is expected behavior and not a defect).

    Once you increase the amplitude of the input sine wave, the ADC will eventually produce numbers above 0. If you interpret the result as unsigned 16-bit integer numbers, the component of the sine wave that is below 0: 'X' < 0 will appear as 65535 - 'X', close to the top range of the unsigned 16-bit int and therefore at the top of the plot. Once the signal crosses 0 (the sine wave is above the -70mW offset), the plot will interpret the data for 'X' >= 0 as 0 + 'X' instead of 65535 - 'X'. That where you see the big jump in the plot from top (65535) to base line (0).
    This becomes apparent with greater amplitude and is clearly visible in your last two plots.

    >>"What I think is that if I use the 16bits word length for sampling, the range for the unsigned digital data should be 0~65535. "

    The data range from the AIC23(b) is [-32768 to 32767]. It is not [0 to 65535] because it doesn't produce unsigned 16-bit integers but signed 16-bit integers (two's complement).

    Regards,
    Dominik.

  • Thank you very much!

    I see.

    I think I can still use unsigned 16-bit data and put it to Q15 format,then the range will in (-1 to 1). Is that right?

    By the way, I think the -70mV offet must be introduced by the AIC23(b). Because inside the LINEIN port there is a capacitance for DC preventing.

    Best regards.

  • If you just take the data from the AIC and have your software interpret it as Q15, the result will be [-1 to 0.999999]. There is no need to use unsigned 16-bit data and convert it to Q15 format.

    For example (pseudo code):

    void ReadFromAIC(int16 *pData, unsigned int nLength); // function reads nLength number of 16-bit words to buffer at address pData

    ......

    Q15 data[1024];
    ReadFromAIC((int16*) data, 1024); // 1024 16-bit words from the AIC will be stored in buffer data, which holds 1024 Q15 words.

    Regards,
    Dominik.