LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In the cross correlation array there are two peaks which give the time delay between the two sources. How to identify them

Hi everyone
 
In my set up I have two sources and I am using two microphones to idenitfy the delay between these two sources. If two microphones are placed in front of the two sources then in the cross- correlation graph there are two peaks ( one in +ve & the other with same index number but in the -ve direction ) giving the delay between the two peaks. The problem is how to develop a code so that one can identify these two peaks automatically. Because right now when I run the programme I know about the location of two indexes so I can iodentify them but if I don't have any information about the information of the location of the source then how can I identify them.
 
The problem is that the cross-correlation array has values for each index number so how to identify the indexes of the only two required peaks?
 
Ankit
0 Kudos
Message 1 of 6
(3,444 Views)
Hello,
 
Have you tried using peak detector.vi?  You can find it in Analyze -> Signal Processing -> Time Domain palette.  You can set a threshold in that VI to help detect only the peaks you want.  If you know the values of your peaks, you can also use the array search function to return the indicies of those values.
 
I think that will help you achieve what you want.
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 6
(3,439 Views)
Hi JLS
 
Thanks for replying.
 
Now the problem is that I can locate the two peaks in the cross-correlation graph manually ( I mean by looking at the graph), & when the program is running continuously the two peaks alos stay there if the location of the source is not changed. But the cross-correlation graph has values for all the indexes ( there are two three peaks from the same source and I just look at the maximum peak ). This is why I am not able to figure out a way to identify the two peaks. Now regarding the threshold vi the two again the problem is that the cross-correlation graph has values for cross-correlation for all the indexes.
 
If you can help me out it would be great.
 
Ankit
0 Kudos
Message 3 of 6
(3,427 Views)
Hello,
 
To be quite honest, I don't think I understand exactly what problem you're having.  If you can boil down your question to something more specific (such as, I have an array which contains N local maximum, and I'd like to determine the distance between peaks whose values differ by no more than M), I will try to guide you to the algorithm and corresponding LabVIEW functions which may be helpful to you.
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 6
(3,422 Views)

Hi

I am sorry for being so much confusing.

What I am trying to do?

I have two arrays and I know that these two arrays(data from the two sources) will have two peaks(each peak corresponds to a single source) on passing through the cross-correlation vi.

When I look at the waveform graph on zooming I can easily identify the two peaks( as there are only two such points shooting high than the rest of data ) with their respective dealy( index on the cross-correlation waveform).

The two peaks are different in magnitude( like one peak has a value 0.9 and the other one has a value of 0.75). Other than these two peaks cross correlation waveform has some values for all the indexes( varying from -1 to1). How to identify these two peaks automatically.

I will try to send you a snap shot of the cross correlation wave form graph.

Thanks&Regards

Ankit 

0 Kudos
Message 5 of 6
(3,419 Views)
Hello,
 
No problem, I was just hoping to clarify so hopefully I can help you find a solution!  If your peaks "stand out" from the rest of your data, then the peak detection VI should help.  However, it sounds like if your peaks are around .75 and .9,and the rest of your data varies from -1 to 1, then your peaks don't really "stand out."  In this case, do you have any other indicators for your peaks?  Can you use some information about the delay to reduce the subset you have to analyze for each peak?
 
The screenshot you noted you may post, with an indication of the peaks of interest, should be very helpful!
 
Best Regards,
 
Jassem
Best,
JLS
Sixclear
0 Kudos
Message 6 of 6
(3,407 Views)