LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PCV based TDOA Estimation

Kindly review this post with refrence to the attached pdf and see section III time delay estimation. I have actually implemented mathematical equations in labview to estimate time delay.I am constructing a signal and making a delyed version of it.But I am unable to find same time delay at the output.The input time delay and estimated time delay should be same.

0 Kudos
Message 1 of 8
(3,975 Views)

I've been studying this VI for a few hours now and I have noticed a couple of problems. First is that you are using the numeric multiply function to calculate the correlation matrix when, I believe, that you want to use the AXB Matrix multiply function found in Mathematics > Linear Algebra. I tried it out and I believe that it solved one problem, but there is still something else keeping the VI from working correctly.

 

Also, I noticed that the in order to calculate the Delay in Sample (O/P) you use the index of the maximum value after the FFT. Because there are only 2 indices in that vector, the delay can only have the values of 0 or 1. This is obviously a problem because you would like for the value to reach 25. There must be something wrong with how you have set that part up.

 

I've been going over the math along with your code and I believe that everything looks good until you get up to the part where you find the arg max of the Rxx vector. The mathematics is very complicated and I'm not sure exactly how you would want to program that part. All that I know is that it appears that that portion is incorrect. Would you be willing to look over that part and make sure that you are calculating the arg max correctly?

 

Good luck!

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(3,932 Views)

with refrence to u r statement (I've been going over the math along with your code and I believe that everything looks good until you get up to the part where you find the arg max of the Rxx vector).Actually I am not finding any argument from Rxx.I feel Rxx is correct because it must be square.Since I have two signals, the size is 2x2 which is right.2ndly If u see the mathemetical expression/equation No.4 in section-III in the paper, I think it is not that complicated as it is just averaged version of my implementation of Rxx i-e Rxx=E[x(f)f.{hermitian of x(f)}].

Apart from the statement (Because there are only 2 indices in that vector, the delay can only have the values of 0 or 1) u r quite right and this is the thing which is bothering me most.Consider my Rxx is right, then refrence to the my calculated Rxx, the steps followed up to equation 5 is right, u can see the outputs at the front pannel.Till eq 5, everything is in freq domain and I am then implementing eq 7 which is inverse FFT.So i thing implementation between equation 4 and 6 is correct, we just need to look at section Before Rxx and verifying Rxx.Then we have to look at the end section which  is after calculating principle component vector V1(wf) eq 5.The point is that I am delaying a signals in samples which is known to me and at the output time delay must comes in samples which must equal the input delayed samples.Hope what I am trying to execute.I am attaching a VI which is quite similar interms of my requirement for time delay estimation.See the attachement to let u know my requirement for it.May be we can skip FFT and inverse FFT based processing.

Download All
0 Kudos
Message 3 of 8
(3,919 Views)

To me, Equation 8 seems to say that the time delay is equal to the arg max of the Rxx matrix. Is that right?

 

Also, could you educate me on how to find the strongest eigenvalue when the eigenvalues are complex? Right now the VI is set to find the maximum real value and if there are two with the same real value, then it will look for the one that has the highest imaginary number. Is that what you intended, or would you rather take the square root of the sum of the squares of the real and imaginary parts?

 

Jeremy P.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(3,906 Views)

Eq i8 s actually eigen structure based function.Now if u see the inner experssion at the right of integral in eq .7, it is eigen vector (The strongest eigen vector which correspond to signal).You can call it eigen vector and with refrence to paper, it is principle component vector. According to your statement (To me, Equation 8 seems to say that the time delay is equal to the arg max of the Rxx matrix. Is that right?) , once you obtain Rxx matrix i-e eq 4, the steps involve after that is to get eigen vectors and eigen values.Now after that we need to sort eigen values in descending order so that strongest eigenvalue comes first.The strongest eigenvalue will guide us to get strongest eigen vector.That eigen vector which is V i,j (omega) is in the expression 7.This is how i understood the flow of algorithm, may be I have skipped some crucial point in understanding but for me this is what i understood from that paper.It is unfortunate but yes no success yet.There is a differenc in Rxx (Correlation matrix) while on other hand in eq 8. the Rxi,xj is eigen structure based function extracted from Rxx after several steps I explained earlier.Hopefully you are getting what I am trying to implement and troubleshoot 🙂

 

0 Kudos
Message 5 of 8
(3,896 Views)

After looking at the paper and your VI, it feels like what you're doing is finding the strongest eigenvalue in order to get the strongest eigenvector. Looking at the paper however, it looks like equation 7 is saying that you need to find the generalized cross correlation function (Rxi,xj) between elements of the principal component vectors V1i and V1j over a range of frequencies. Once you get this function, you should be able to get the time delay sample by finding the peaks of Rxi,xj (what the paper refers to as the eigenstructure-based GCC or ES-GCC)

Gabriel M.
Product Marketing Engineer - Academic Courseware
National Instruments
0 Kudos
Message 6 of 8
(3,866 Views)

I totally agree what you have earlier said about eq.7 but I feel that I have extracted column 1 from eq.6 which will be needed in eq.7.Since I am considering that I have 2 elements and 1 signal in the environment, I must get 1D vector having two elements.Let me share my understanding about the expression 7 i-e V1,i and V1,j means signal one and ith and jth elements.So may be we can sort out how to execute equation 7 since my undertanding about the paper says that I am getting eq.5 for my case which is (2 elements and single source) correctly.

0 Kudos
Message 7 of 8
(3,845 Views)

Yes, it looks like to implement expression 7, you would need to integrate V1,i * V1,j * e^j(omega)(tau) over the frequencies, omega1 to omegaf, where omegaf is the frequency band after the Fourier transform and omega1 is the frequency band of the vector that you extracted from the matrix E1 in expression 6. I'm not exactly sure how you would go about doing that but I would suggest looking at the mathscript module.

Gabriel M.
Product Marketing Engineer - Academic Courseware
National Instruments
0 Kudos
Message 8 of 8
(3,829 Views)