I'm trying to figure out the phase difference between two waveforms I downloaded from an oscilloscope. They are 1X2500 matricies. Here's the code I'm using (w1 and w2 are two waveforms I got from the oscilloscope with the getWaveform command)
CosTheta = dot(w1,w2)/(norm(w1)*norm(w2));
ThetaInDegrees = acosd(CosTheta)
This only gives me the absolute value of the phase. I don't know if it's negative or positive. How could I get this answer?
Thanks!

1 comentario

John BG
John BG el 14 de Jul. de 2016
is it possible for you to show the signals?

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 14 de Jul. de 2016
Editada: Star Strider el 15 de Jul. de 2016

1 voto

The sign of the phase depends on the waveform you use as the reference. The xcorr function could help you decide that.
EDIT (15 Jul 2016 16:15 UTC)
They appear to be slightly different frequencies. They will never have a constant phase relationship.

4 comentarios

John BG
John BG el 28 de Jul. de 2016
if
w1=2*pi*f1*t+ph1
w2=2*pi*f1*t+ph2
these 2 signals may have same frequency but may also have different relative phase, that can be constant or not.
So I doubt, without further information, that the frequencies are categorically different and therefore one cannot say that 'they will never have constant (relative) phase'
Star Strider
Star Strider el 28 de Jul. de 2016
You didn’t see the original waveforms. That file may have been deleted in the interim to conserve space on the server.
Second-guessing is worthless if you don’t have the original data.
John BG
John BG el 28 de Jul. de 2016
Editada: John BG el 28 de Jul. de 2016
' .. 1X2500 matricies..' out of an oscilloscope, may have been deleted, but no one know the size, correct?
Have you seen them? if so can I have a look?
Anyway, I agree, 2nd guessing is pointless.
Star Strider
Star Strider el 28 de Jul. de 2016
The file was posted. I did not keep a copy of it.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 14 de Jul. de 2016

Comentada:

el 28 de Jul. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by