05-23-2008 09:56 AM
05-27-2008 04:44 AM
05-27-2008 05:55 AM
Hi Ian,
Many thanks for the offer of help. The relevant line of script that I have been using is: Call CHNCORRELNCROSS("Time temp","SR30 Latac","RT3000 Latac","X_CCF","N_CCF","TimeDomain",50), although when it fails I have to reverse the signal channels thus: Call CHNCORRELNCROSS("Time temp","RT3000 Latac","SR30 Latac","X_CCF","N_CCF","TimeDomain",50). There is no error when the analysis trips up as the function returns usable data but the data returned is non-sensical to the rest of my code. As the two signals are essentially the same my code relies on finding the maximum value in the N_CCF channel, which should represent the time shift required to line to the two signals up. Typically the peak value is in the order of 0.7 to 0.8 and, due to the form of the signal, is clearly the peak of interest. On the occasions when the code fails the N_CCF channel contains values that are a miniscule fraction of unity, thus implying no correlation between the signals. For info, the X_CCF channel is identical in both cases and the "Time temp" channel is linearly increasing as required (this I discovered as necessary as the time increments in the output file from the OTS RT3000 are not always equispaced!!!)
The file formats are a CSV Excel file from the OTS RT3000 and a tab-delimited text file from the ABD steering robot. However, both file formats are imported and saved as a single DIAdem TDM file before the code is run.
Please let me know if you wish me to email you the relevant data.
Regards,
Si.
06-09-2008 10:29 AM
06-09-2008 11:03 AM
06-09-2008 11:07 AM
Hi
Can you zip all of the files together, then attach it?
Thanks
06-09-2008 11:12 AM
Hi Beejal,
Can do. Should be attached. The VBS will run the cross correlation issue on a working and non-working set of data. It will also run the function with the input signals in the alternative order to that which my code normally uses. Paradoxically, if you run the function on the working data but with the signals in the alternative order then you also get unexpected results. I would expect the function to produce the expected results regardless of the order of the input signals.
Cheers,
Si.
06-10-2008 03:46 AM
Hi
Thanks for that. I will have a look at it and get back to you as soon as possible.
Regards
06-10-2008 05:54 AM
Hi
I have been looking at your issue and I can now see exactly what you mean. I have not yet been able to find a reason why the resulting data appears to be swapped, so I will escalate this issue for you.
In the mean time you can use a work around to ensure that your result generation is still automated. You can add some error checking into your VB script. Once you have run the initial cross correlation function, you can do a peak check to make sure you have a peak above 0.6. If you do not have a peak you can then delete the calculated data and run the cross correlation function again, swapping the SR30 and RT3000 parameters in the function. You can then run the peak check function again to make sure you do have the peak. If there is still no peak you can output and error.
By implementing this into your script you can ensure that the data will be in the correct order.
I will let you know as soon as possible if I get an any answers from escalating this error.
Regards
06-23-2008 04:50 AM
Hi Si,
I haven't have a look into your code yet. However, I am working on a very similar topic. I have data acquired in two different formats. I convert them in DIAdem format & create a new .tdm file. To synchorise the data, I downsample them & then use the same cross-correlation function which you use.
By going through your post, I found that I have little difference in implemenation. I use "Frequency Domain" in CHNCORRELNCROSS() function instead of "Time Domain". Also I find the peak value by following statement:
Dim peak: peak = ChnFind("ValEqual(Ch("NormalizedCrossCorrelated"), CMax("NormalizedCrossCorrelated"))")
Still now, I am yet to face any problem. I also feel that the order of the channels in CHNCORRELNCROSS() function should cause any problem.
On the other hand, if you swap the two channels, there would be different results for the maximum normalized correlation value. I tried it with my data. However, the difference is marginal for my analysis (to the order of 0.001 for peak correalation value).
Hope this might help to some extent. In my experince too, DIAdem behaves little awkwardly at times.
With warm regards,
Saurav