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 on c5402

Hi,first  i am sorry for my English is not good .I use the codec TLVAIC23B and c5402 to acquisition and play audio with McBSP and DMA,

TLVAIC23B :16bit 44100Hz

int ADbuf[]     ADC data

int DAbuf[]    DAC data

when  DAbuf[i]= ADbuf[i]*2  ,it plays well

but when i set DAbuf[i]= ADbuf[i]/2,it has big noise,why?

  • Hi,

    What speed are your CPU running? Have you checked the DAbuf[i] value when ADbuf[i] is divided by 2?

    Regards,

    Hyun

  • thx,

    cpu speed 100Mhz

    i have checked ths DAbuf[i] value with ccs2 " watch window",and is right.

    is the aic23 ADC value unsigned?Should I define DAbuf[] as unsigned short?the aic23 sample sine wave range (-1,1),does 0xFFFF stand for 1,and 0 for -1,

    or -32767 for -1 ,32767 for 1?

    how do I reduce the volume using cpu?

  • Hi,

     

    Please try following:

    unsigned int x=0xffff;

    int y=0xffff;

    int z=-1000;

     

    printf("x=%d x*0.5=%d \n", x, (int)(x * 0.5));

    printf("y=%d y*0.5=%d \n", y, (int)(y * 0.5));

    printf("z=%d z/2=%d \n", z, (int)(z / 2));

     

    Stdout:

     

    x=-1 x*0.5=32767 

    y=-1 y*0.5=0 

    z=-1000 z/2=-500 

     

    Also add #include <math.h>

    Regards,

    Hyun