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.

Reading data from .pcm file stored as 32 bit float

Hi all, 

I am having trouble reading data into CCS 4.0, from a .pcm file which has data stored as 32-bit float. 

If someone has a link for this please send. 

Here is my code: 

Thanks and regards,

AAV.

//globals

complex in_data[FFT_LENGTH];       // data read from the .pcm file.

Int16 inter[1024*4]; 


// in main( )
// Formatting the byte read done by CCS
{
Int32 val;
Int32 val0, val1, val2, val3;
n = fread(inter,sizeof(float), 2 * 256, fp_in);
if(n < (2 * 256))
{
puts("EOF reached\n");
break;
}
for (i=0; i<256; i++)
{
val3 = (Int32)(inter[(4*i)+3]);
val2 = (Int32)(inter[(4*i)+2]);
val1 = (Int32)(inter[(4*i)+1]);
val0 = (Int32)(inter[(4*i)+0]);
val = (val3<<24) + (val2<<16) + (val1<<8) + (val0<<0);

in_data[i].re = (val*1.0) / 2113929216.0;
in_data[i].im = 0;
}
} // end of Formatting the byte read done by CCS