LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CrossCorrelation of two values

An array consisting of double values describes a sawtooth function. I also receive real-time measurements from a data source that exactly match this function. Now, the values are delayed, and I want to align the reference values, i.e., those in the array, with the real-time values. I want to overlay both plots and show that they are identical and confirm this with a boolean. I thought I would do this via the CrossCorrelation VI. And then take the highest point, which describes the complete overlay. Now it takes a bit too long until the exact highest point of the Rxy is reached. Is there no other way where I can compare the actual values? So that the points align?

0 Kudos
Message 1 of 14
(563 Views)

There are plenty of ways to compare two signals, some have been discussed in your earlier thread. Have you tried anything new?

0 Kudos
Message 2 of 14
(524 Views)

But now I know actually this two signal are equal. 

What to shift my measured signal over my reference array and and want to show are they equal.

Do u have any example for that? How show that clear and fast?

0 Kudos
Message 3 of 14
(517 Views)

Do u have any Idea with cross correlation two show two signals are similar or the measured values are on the refeeenz signal with an shift

0 Kudos
Message 4 of 14
(493 Views)

Hello, @medum.

 

There seems to be a communication problem here.  You have asked a somewhat vague question about an unknown "signal" that you have not shown us, asking how to compare it with another "signal", a sawtooth wave (which you also haven't shown us) and a method (cross-correlation) that I'm not certain you understand.

 

Do you have an example of the signal you want to analyze?  Do you know its "properties", i.e. its amplitude, frequency (of the sawtooth), phase (relative left-right shift on the time axis) and offset (relative up/down shift on the Y axis)?  Can you attach a file with such a signal (if it is too large, compress it with Zip)(the easiest way to do this is to include the data file in your LabVIEW Project folder that contains your code, then click on that folder and choose "Send to:", "Compressed (zipped) folder").

 

If you know the above-listed properties of your signal, you can generate a Waveform with exactly the same properties (oh, you need to know the sampling rate of the signal, as well) by going to the Waveform Palette, Analog Waveform, Generation, Sawtooth to find a function that will generate a sawtooth waveform with the amplitude, frequency, etc. properties that you need.  Plot you "sampled" waveform and your "generated" waveform on the same graph.  If you "matched the properties" right, they should overlap.

 

And if you send us your code and your data, as we keep asking, we could provide not only "here's how to solve your problem, but you don't know enough LabVIEW to even understand the solution" to "here is how to learn what you need to understand LabVIEW enough to know how to do this yourself".

 

If sending LabVIEW code, remember we old-timers use old-time LabVIEW (2019, 2020, 2021, not 2022 or higher).

 

Bob Schor

0 Kudos
Message 5 of 14
(465 Views)

@medum wrote:

An array consisting of double values describes a sawtooth function. I also receive real-time measurements from a data source that exactly match this function. Now, the values are delayed, and I want to align the reference values, i.e., those in the array, with the real-time values. I want to overlay both plots and show that they are identical and confirm this with a boolean. I thought I would do this via the CrossCorrelation VI. And then take the highest point, which describes the complete overlay. Now it takes a bit too long until the exact highest point of the Rxy is reached. Is there no other way where I can compare the actual values? So that the points align?


I'm not sure if this will help or not (it's hard to say in absence of your real signals), but here's just an idea:

 

phase diff.png

Some minor "fine tuning" options also available.

Message 6 of 14
(457 Views)

my idea:

Could i use the crosscorrelation.vi? 

Because when  i have the maximum point rxy that should be always the sme maximum? because i want to detected mistakes. 

do u have for that an example?

0 Kudos
Message 7 of 14
(427 Views)

@medum wrote:

my idea:

Could i use the crosscorrelation.vi? 

Because when  i have the maximum point rxy that should be always the sme maximum? because i want to detected mistakes. 

do u have for that an example?


Yes, for sure you can, but in the first message you wrote: " Now it takes a bit too long until the exact highest point of the Rxy is reached. "

Anyway:

crosscorr.png

This is how it works:

reg.gif

But again, synthetic test is just synthetic test, but real signal is real signal, they could be very different...

Message 8 of 14
(412 Views)

Thank u very much! 

My aim is to proof that my reference signal is equal to my real time signal. Actually my reference signal is an array 1D and my real time signal is always updating. This two signal should be exact equal. I am not sure if this the clever way.

How would I apply this example? If I have a reference array and a real-time signal, and the reference array represents my boundaries, meaning it corresponds to my upper and lower limits. What would such a VI look like? Can I simply connect my reference array to the range VI?

It´s this possible?

0 Kudos
Message 9 of 14
(409 Views)

@medum wrote:

Thank u very much! 

My aim is to proof that my reference signal is equal to my real time signal. Actually my reference signal is an array 1D and my real time signal is always updating. This two signal should be exact equal. I am not sure if this the clever way.

How would I apply this example? If I have a reference array and a real-time signal, and the reference array represents my boundaries, meaning it corresponds to my upper and lower limits. What would such a VI look like? Can I simply connect my reference array to the range VI?

It´s this possible?


Assumed that you will replace upper SawTooth Waveform simulation with your "reference" signal and lower, where phase gets changed with your actual signal and see what happened. If you need to check that the signals _exactly_ the same, may be simple subtraction will help, then check difference with simple threshold and may be you looking for too complicated solution for too simple problem.

0 Kudos
Message 10 of 14
(403 Views)