maltab txt code

Status
Not open for further replies.

tigercotter

New Member
I want to the phase difference between between two signals as explained in the attachment about the zero crossings of the two signals will not match up?
 

Attachments

  • zero_cross.zip
    14 KB · Views: 147
Could you clarify your question? It's not particularly clear.

Anyway to get phase difference you could use:

[y1,t1] = max(sinSignal1) and then
[y2,t2] = max(sinSignal2)

and

phase_difference=t2-t1

Then convert phase difference from time to degrees, and use if statements to detect leading or lagging
 
I am collecting data through labview. For instance if the second signal goes to zero on the negative slope and this is its first zero crossing while the second signal has its first zero crossing on the positive slope i.e from neg peak to positive peak, these two times should gine the wrong time difference
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…