AnsweredAssumed Answered

how to understand a example of tigersharc 201 dsp (visual dsp++5.0)?

Question asked by shedmaze on Dec 20, 2012
Latest reply on Dec 21, 2012 by CraigG

hello,

  right now i am learning the tigersharc dsp by myself, and i have bought a tigher sharc EZ-kit lite board, totally i has bought 3 boards.

  i read an example in the following path:    \VisualDSP 5.0\TS\Examples\ADSP-TS201 EZ-KIT Lite\Power_On_Self_Test

 

  in this project, it has a file  audio_test.c, and in this file, the following codes confused me, can you help me??  thank you and thank you.

 

void audio_int( void )
{
int iChannelX_Left;
int iChannelX_Right;
float fChannelX;


iChannelX_Left = ReadDataLeft;
iChannelX_Right = ReadDataRight;

// shift 24-bit codec data left channel
iChannelX_Left <<= 8;
    iChannelX_Left >>= 8;                                   //  what has it done??   i don't know. it seems there is no change for the iChannelX_Left  
   
    // sign extend values
if( iChannelX_Left & 0x800000 )
{
     iChannelX_Left |= 0xFF000000;                    // this part is also, i don't know what are they doing ...?
}

// shift 24-bit codec data right channel
iChannelX_Right <<= 8;
    iChannelX_Right >>= 8;
   
    // sign extend values
if( iChannelX_Right & 0x800000 )
{
     iChannelX_Right |= 0xFF000000;
}

Outcomes