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.

OMAP-L138: Data with noise when the dsplib is used

Part Number: OMAP-L138

Recently, I used OMAPL138LCDK to process audio data. I used the C6748 core and there was no OS. I used AIC3106 and EDMA3 to acquire audio data.

At the beginning of main() function, cache was enabled by following functions

 

CacheEnableMAR((unsigned int)0xC0000000,(unsigned int)0x10000000);

CacheEnable(L1PCFG_L1PMODE_32K | L1DCFG_L1DMODE_32K | L2CFG_L2MODE_256K);

 

Then  the AIC3106, McASP, and EDMA3 are initialized by the following function

ReceiveDataInit();

 

I used two buffers (ping buffer and pong buffer) to receive the data alternately. The sampling rate was 48000 symbol/s, the length of one buffer is 160 ms.

When the EDMA was full, the flag BufFull was set to “1” in the interrupt service function, which informed the CPU that, there was new data in the buffer.

In the main function, the CPU always check the if there was new data.

If there was new data, the CPU copied the data to data[0][] (left channel) and data[1][](right channel), also the new data was copied in recdata_ch1[] and recdata_ch2[]

/********************************************************************/

//copy the ping buffer to data[0][]  recdata_ch1[], the same with pong buffer

  if(BufFull==1)

{

BufFull=0;

CacheInv((unsigned int) (rxBuf0),sizeof(rxBuf0));    

CacheInv((unsigned int) (rxBuf1),sizeof(rxBuf1));

for(i=0;i<BUFF_SZ;i++)

{

  temp=((rxBuf0[4*i+1]<<8)+(rxBuf0[4*i]<<0)-OFFSET);  //transformed to 16 bit

          data[0][i+BUFF_SZ]=1.0f*temp/32768.0f;       // transformed to float

          recdata_ch1[cnt]=1.0f*temp/32768.0f;

          temp=((rxBuf0[4*i+3]<<8)+(rxBuf0[4*i+2]<<0)-OFFSET);

          data[1][i+BUFF_SZ]=1.0f*temp/32768.0f;

          recdata_ch2[cnt]=1.0f*temp/32768.0f;

      cnt++;

}

}

/***********************************************************/

When copying the new data was finished, the convolution operation was conducted by

 

Mem_Copy_float(ConvIn+SYNCLEN-1,&data[0][0],2*BUFF_SZ);

//copy left channel data to ConvIn array

DSPF_sp_convol(ConvIn, LocalSync, ConvOut, SYNCLEN, CONVOUTLEN);

 the time that convolution function spent was less than 160 ms.

After 25 s, the recdata_ch1[] was exported, shown fig.1.

Fig.1 signal with noise

We can see that, there is noise in the fig.1, marked with red rectangle, the intervals between the two noise is 160 ms (one buffer length).

When I commented convolution function, the signal is shown in fig.2. We can see that, in the silence interval, there is no noise.

Fig.2 signal without noise

I do not know why. It must be the data coherence between DMA and Cache. Can someone help me? Thank you very much.