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.

Audio processing on tms320C6748 lcdk using starterware- working with channels

Other Parts Discussed in Thread: TMS320C6748

Hi,

I would like to do audio lms filtering and FIR/IIR filtering. I started with modyfying mcaspPlayBk.c from StarterWare.

I would like to work with both channels. First I want to let play only right channel, left channel and then swap left channel data with right channel data. I wrote following code and use it instead of memcpy() in mcaspPlayBk.c.

for(j=0;j<=(BUFLEN/4)-1;j++){

            sample1=*((unsigned short*)rxBufPtr[lastFullRxBuf]+4*j);//should be right channel
            sample2=*((unsigned short*)rxBufPtr[lastFullRxBuf]+2*j+1);//schould be filled with 0
            sample3=*((unsigned short*)rxBufPtr[lastFullRxBuf]+4*j+1);//schould be left channel

           *((unsigned short*)txBufPtr[lastSentTxBuf]+4*j)=(unsigned short)sample1;
           *((unsigned short*)txBufPtr[lastSentTxBuf]+2*j+1)=(unsigned short)sample2;
           *((unsigned short*)txBufPtr[lastSentTxBuf]+4*j+1)=(unsigned short)sample3;
            }

I expected following:

1)  when I will write sample1,2 and 3 on the same position, where I have read them out. I will hear both channels, as normal.

2)  when I let sample 1 on the correct position and  write 0 to correct position of sample3 . I will hear only right channel.

3)  when I let sample 3 on the correct position and write 0 to correct position of sample 1. I will hear only left channel.

4)  when I will swap sample1 and 3. I will also hear swept channels.

But in cases 1) and 2) I can hear only right channel and in other cases I can hear nothing.

Please can you point me a way how to separate an audio stream into right channel and left channel and swap the channels? And one more question is correct the idea stereo filtering= left channel filtering+ right channel filtering.

Thank you for your answers.

I am using:

TMS320C6748 lcdk Ver 5

Code Composer Studio Version: 5.3.0.00090

C6748_StarterWare_1_20_03_03

dsplib_c674x_3_2_0_1

  • It works now.

    I made a mistake in indexing of left channel.

    It schould be 4*j+2 instead of 4*j+1.

    I thought the problem is in data format.

    Perhaps it helps somebody with audio proccessing.

    Petr Duga