Hello everyone,
I am working on the implementation of a real time FFT for an audio signal on DSK6713.I have to do some further analysis after viewing the FFT plot of the signal.The input signal is given through the Line IN. Hence,i need to view the plot of the FFT and the input signal that i have given, to check my code and to do further analysis.Can this be done by adding Breakpoints and viewing the time-graph. Please help me out.
I have pasted the processbuffer() function that I modified in my code.
void processBuffer(void)
{
Uint32 pingPong;
int i;
float mag[BUFFSIZE];
/* Get contents of mailbox posted by edmaHwi */
pingPong = SWI_getmbox();
/* Copy data from transmit to receive, could process audio here */
if (pingPong == PING) {
/* Toggle LED #3 as a visual cue */
DSK6713_LED_toggle(3);
for(i=0;i<BUFFSIZE;i++)
{
x[2*i]=(float)gBufferRcvPing[i]; // changing RcvPing from int16 type to float type for FFT calculation
x[2*i+1]=0.0;
}
tw_genr2fft(w,BUFFSIZE);
bit_rev(w,BUFFSIZE>>1);
DSPF_sp_cfftr2_dit(x,w,BUFFSIZE);
bit_rev(x,BUFFSIZE);
/*for(i=0;i<BUFFSIZE;i++)
{
mag[i]=sqrt((x[2 * i] * x[2 * i]) + (x[2 * i + 1] * x[2 * i + 1]));
//gBufferRcvPing[i] = (Int16)mag[i];
}*/
bit_rev(x,BUFFSIZE);
DSPF_sp_icfftr2_dif(x,w,BUFFSIZE);
divide(x,BUFFSIZE);
for(i=0;i<BUFFSIZE;i++)
{
gBufferRcvPing[i]=(Int16)x[2*i];
}
/* Copy receive PING buffer to transmit PING buffer */
copyData(gBufferRcvPing, gBufferXmtPing,BUFFSIZE);
} else {
/* Toggle LED #2 as a visual cue */
DSK6713_LED_toggle(2);
for(i=0;i<BUFFSIZE;i++)
{
x[2*i]=(float)gBufferRcvPong[i]; // changing RcvPing from int16 type to float type for FFT calculation
x[2*i+1]=0.0;
}
tw_genr2fft(w,BUFFSIZE);
bit_rev(w,BUFFSIZE>>1);
DSPF_sp_cfftr2_dit(x,w,BUFFSIZE);
bit_rev(x,BUFFSIZE);
/* for(i=0;i<BUFFSIZE;i++)
{
mag[i]=sqrt((x[2 * i] * x[2 * i]) + (x[2 * i + 1] * x[2 * i + 1]));
// gBufferRcvPong[i] = (Int16)mag[i];
} */
bit_rev(x,BUFFSIZE);
DSPF_sp_icfftr2_dif(x,w,BUFFSIZE);
divide(x,BUFFSIZE);
for(i=0;i<BUFFSIZE;i++)
{
gBufferRcvPong[i]=(Int16)x[2*i];
}
/* Copy receive PONG buffer to transmit PONG buffer */
copyData(gBufferRcvPong, gBufferXmtPong,BUFFSIZE);
}
}
Thanks
Uday