From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculation of the phase difference of two signals - NI COMPACT RIO

Hello!,

 

I want to calculate the phase difference between two Signals. One signal looks like a sine, and the second one is a square wave signal from an inductive sensor.

 

In the process the signal from the sine is shifted - and i wanted to know this phase difference. 

 

so i tried two different methods:

 

the first is: i use the " extract single tone information VI" for both signals and calculate the phase difference between this two signals.

 

the second is: (this is my favorite  solution, because the calculated phase is smoother.)

 

i use the extrac single tone information VI to calculate the phase and the frequence of the signals and generate 

a "perfect" square wave and sawtooth from the sine signal and than a calculate the phase difference by evaluate the falling edge of both signals.

 

My question is:

 

i have problems with the calculation, because sometimes the signals jumps?? ( in my example by a simulated phase difference of -20degree ) - and i dont know why? .. how can i avoid ths behavior?

 

what would be a better / proper solution?

 

Another question is: are there any function where i can calculate / evaluate / the useful signal to the noise signal? 

 

Is it better to do filtering on the FPGA? or on the real time system? - i havent found some possibilities to influence the frequence of the filter during the runtime.?

 

Thank you very much for your time!

 

With best regards

Stefan

 

 

0 Kudos
Message 1 of 1
(553 Views)