AnsweredAssumed Answered

I don't have an output from my cross correlation function.. how can i make it work??

Question asked by marclouieyap on Feb 16, 2010
Latest reply on Feb 18, 2010 by marclouieyap

hi,

 

I am Marc. I am new to the EZkit BF537. Currently I am trying to implement cross correlation of two real time signals acquired by a pair of stereophonic microphones with size of 128..

 

the program was built and running. My only problem is when i try to look at the blackfin memory for the "lags" and "out", there are only zeroes in it.. I tried to generate two similar signals with a certain lag using matlab and played it continuosly while the ezkit is acquiring the signal through an audio cable however the blackfin memory shows that there are no values for the "lags" and "out". i can only conclude that there is something wrong with my implementation.

 

I need help and guidance in making cross correlation work.. thanks in advance 

 

my implementation is as follows

 

 

#include "Talkthrough.h"

#include <stats.h>

 

int lags;

int z = 0;

int samples = 128;

 

 

 

void Process_Data(void)

{

int i;

 

// input size is equal to 32

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

{

     sChannel0LeftOut[i] = sChannel0LeftIn[i];

     sChannel0RightOut[i] = sChannel0RightIn[i];

 

 

     Left[i+32*z] = sChannel0LeftIn[i];

     Right[i+32*z] = sChannel0RightIn[i];

 

}

 

 

if(z==0)

{

     z++;

}

else if(z==1)

{

     z++;

}

     else if(z==2)

{

     z++;

}

     else if(z==3)

{

     z=0;

     crosscorr_fr16(Left, Right, samples, lags, out);  // "left", "right" and "out" are being declared as fract 16 types on a

                                                                                               separate file

 

}

 

 

 

}

 

i also attached the whole file

Attachments

Outcomes