Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

find phase of the sinusoidal signal from myrio

Hi,

 

I am trying to find the phase of two sinusoids from function generator onto myRIO. I have acquired the signals, did the ffts, plotted the signal itself, but i cant seem to find either the phase difference or the phase of individual signals. I am acquiring signals from dual-channel function generator. I used the tone information extraction vi, but it doesnt work .Smiley Sad      Also i can't figure out how to find the phase from fft and/or cross correlation. I have attached my vis. Pls help.

Thank you.

0 Kudos
Message 1 of 7
(4,664 Views)

Hi santamaria,

 

This is an example of implementing phase diff measurement with cross correlation.

I dont have the hardware - so I have simulated the signals.

I have added the explanation onto the block diagram.

But if you have questions - please ask.

 

ngene

 

In AI We Trust
0 Kudos
Message 2 of 7
(4,653 Views)

Actually the problem is, since i am running the code in a loop. The phase changes for every loop iteration. I even implemented your code but the phase changes continuously.

0 Kudos
Message 3 of 7
(4,640 Views)

is there a way to store the aquired data in an array in the loop and then use that array outside the loop?

0 Kudos
Message 4 of 7
(4,638 Views)

You could save the data to the array by using a shift register for the array. The second example here shows how you can do this.

 

https://decibel.ni.com/content/docs/DOC-16506

0 Kudos
Message 5 of 7
(4,623 Views)

I think the right way would be to use N Sample Analog input, so it will provide an array of sampled N elements, which you can feed directly the algorithm.

 

ngene

In AI We Trust
0 Kudos
Message 6 of 7
(4,612 Views)

N channel analog input supports only one channel, and i need to use from 2 to 4 analog inputs Smiley Sad

0 Kudos
Message 7 of 7
(4,600 Views)