Hi, Lets say I receice a signal, with 5 samples per cycle as follows - 0.980066578 0.113911467 -0.90966542 -0.676115614 0.49180299 how do I establish the phase lag of this signal? Any straighh forward equations for doing this? Thanks, Aine.
Establishing phase lag of sin signal
Started by ●October 28, 2004
Reply by ●October 28, 20042004-10-28
"?ine Canby" <aine_canby@yahoo.com> wrote in message news:57ed59a.0410280903.5bafce63@posting.google.com...> Hi, > > Lets say I receice a signal, with 5 samples per cycle as follows - > > 0.980066578 > 0.113911467 > -0.90966542 > -0.676115614 > 0.49180299 > > how do I establish the phase lag of this signal? Any straighh forward > equations for doing this?It has to be in reference to something (a reference signal) - so you need to determine that before being able to compute a phase lag. Cheers Bhaskar> > Thanks, > > Aine.
Reply by ●October 28, 20042004-10-28
Assuming that you know a few things:
1) it is a pure sinusoid with unknown amplitude "A"
2) the frequency is below 2*fs
3) the samples are equally spaced
4) you assume that time=zero coincides with the first sample
(well, actually this isn't necessary as long as you plug in the right values
of time in wt below)
You might calculate the sinusoid from a linear system of equations:
A*sin(phi)=0.980066578
A*sin(T+phi)=0.113...
.
.
A*sin(4T+phi)=0.4918....
You know T presumably. So solve for phi.
Example: if T=1 then:
from
A*sin(wT+phi) we get:
A*sin(phi)=0.980066578
A*sin(w+phi)=0.113911467
-
sin(phi)=0.980066578/A
sin(w+phi)=0.113911467/A
sin(2w+phi)=-0.90966542/A
-
3 equations, 3 unknowns w, phi and A.
-
It's really easy to set this up in a spread sheet where the value of
A*sin(wT+phi) for each value of T and trial values of A,w and phi are set
up. Then calculate the sum of the errors^2 and minimize the sum of the
errors squared using Tools/Solver (n Excel) by varying A,w and phi.
It might even be more fun to vary the parameters manually to see how fast
you might converge to a solution.
This yields:
w phi A
1.256636 1.770799 1.000
Where I've assumed that T=1.
Then, of course, if you haven't already done it, you can renormalize w to
the real value W to match the real value of T that you have where W=w/T.
Fred
"?ine Canby" <aine_canby@yahoo.com> wrote in message
news:57ed59a.0410280903.5bafce63@posting.google.com...
> Hi,
>
> Lets say I receice a signal, with 5 samples per cycle as follows -
>
> 0.980066578
> 0.113911467
> -0.90966542
> -0.676115614
> 0.49180299
>
> how do I establish the phase lag of this signal? Any straighh forward
> equations for doing this?
>
> Thanks,
>
> Aine.
Assuming that you know a few things:
1) it is a pure sinusoid with unknown amplitude "A"
2) the radian frequency w (or W) is below 2*fs
3) the samples are equally spaced
4) you assume that time=zero coincides with the first sample
(well, actually this isn't necessary as long as you plug in the right values
of time in wt below)
You might calculate the sinusoid from a linear system of equations:
A*sin(phi)=0.980066578
A*sin(T+phi)=0.113...
.
.
A*sin(4T+phi)=0.4918....
You know T presumably or simply set it to 1.0 for now. So solve for w,A and
phi.
Example: if T=1 and the samples start at t=0 then:
from
A*sin(wT+phi) we get:
A*sin(phi)=0.980066578
A*sin(w+phi)=0.113911467
-
sin(phi)=0.980066578/A
sin(w+phi)=0.113911467/A
sin(2w+phi)=-0.90966542/A
-
3 equations, 3 unknowns w, phi and A.
-
It's really easy to set this up in a spread sheet where the value of
A*sin(wT+phi) for each value of T and trial values of A,w and phi are set
up. Then calculate the sum of the errors^2 and minimize the sum of the
errors squared using Tools/Solver (n Excel) by varying A,w and phi.
It might even be more fun to vary the parameters manually to see how fast
you might converge to a solution.
This yields:
w phi A
1.256636 1.770799 1.000
Where I've assumed that T=1.
Then, of course, if you haven't already done it, you can renormalize w to
the real value W to match the real value of T that you have where W=w/T.
Also, notice that if we use "cos" instead of "sin" in the equations, the
answer for phi is different by pi/4. Generally, phase is determined by the
difference measured from a cosine - and a sine has phase of -pi/4 relative
to the cosine.
Fred
Reply by ●October 28, 20042004-10-28
Fred Marshall wrote:> Assuming that you know a few things: > 1) it is a pure sinusoid with unknown amplitude "A" > 2) the frequency is below 2*fs > 3) the samples are equally spaced > 4) you assume that time=zero coincides with the first sample > (well, actually this isn't necessary as long as you plug in the right values > of time in wt below) > > You might calculate the sinusoid from a linear system of equations: > > A*sin(phi)=0.980066578 > A*sin(T+phi)=0.113... > . > . > A*sin(4T+phi)=0.4918.... > > You know T presumably. So solve for phi. > > Example: if T=1 then: > from > A*sin(wT+phi) we get: > > A*sin(phi)=0.980066578 > A*sin(w+phi)=0.113911467 > - > sin(phi)=0.980066578/A > sin(w+phi)=0.113911467/A > sin(2w+phi)=-0.90966542/A > - > 3 equations, 3 unknowns w, phi and A. > - > > It's really easy to set this up in a spread sheet where the value of > A*sin(wT+phi) for each value of T and trial values of A,w and phi are set > up. Then calculate the sum of the errors^2 and minimize the sum of the > errors squared using Tools/Solver (n Excel) by varying A,w and phi. > It might even be more fun to vary the parameters manually to see how fast > you might converge to a solution. > > This yields: > w phi A > 1.256636 1.770799 1.000 > > > Where I've assumed that T=1. > Then, of course, if you haven't already done it, you can renormalize w to > the real value W to match the real value of T that you have where W=w/T. > > Fred > > "?ine Canby" <aine_canby@yahoo.com> wrote in message > news:57ed59a.0410280903.5bafce63@posting.google.com... > >>Hi, >> >>Lets say I receice a signal, with 5 samples per cycle as follows - >> >>0.980066578 >>0.113911467 >>-0.90966542 >>-0.676115614 >>0.49180299 >> >>how do I establish the phase lag of this signal? Any straighh forward >>equations for doing this? >> >>Thanks, >> >>Aine. > > > Assuming that you know a few things: > 1) it is a pure sinusoid with unknown amplitude "A" > 2) the radian frequency w (or W) is below 2*fs > 3) the samples are equally spaced > 4) you assume that time=zero coincides with the first sample > (well, actually this isn't necessary as long as you plug in the right values > of time in wt below) > > You might calculate the sinusoid from a linear system of equations: > > A*sin(phi)=0.980066578 > A*sin(T+phi)=0.113... > . > . > A*sin(4T+phi)=0.4918.... > > You know T presumably or simply set it to 1.0 for now. So solve for w,A and > phi. > > Example: if T=1 and the samples start at t=0 then: > from > A*sin(wT+phi) we get: > > A*sin(phi)=0.980066578 > A*sin(w+phi)=0.113911467 > - > sin(phi)=0.980066578/A > sin(w+phi)=0.113911467/A > sin(2w+phi)=-0.90966542/A > - > 3 equations, 3 unknowns w, phi and A. > - > > It's really easy to set this up in a spread sheet where the value of > A*sin(wT+phi) for each value of T and trial values of A,w and phi are set > up. Then calculate the sum of the errors^2 and minimize the sum of the > errors squared using Tools/Solver (n Excel) by varying A,w and phi. > It might even be more fun to vary the parameters manually to see how fast > you might converge to a solution. > > This yields: > w phi A > 1.256636 1.770799 1.000 > > > Where I've assumed that T=1. > Then, of course, if you haven't already done it, you can renormalize w to > the real value W to match the real value of T that you have where W=w/T. > > Also, notice that if we use "cos" instead of "sin" in the equations, the > answer for phi is different by pi/4. Generally, phase is determined by the > difference measured from a cosine - and a sine has phase of -pi/4 relative > to the cosine. > > FredAll well and good, but phase lag with what reference? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●October 29, 20042004-10-29
"Jerry Avins" <jya@ieee.org> wrote in message news:2ucs33F25fm19U1@uni-berlin.de...> Fred Marshall wrote: > > All well and good, but phase lag with what reference? > > Jerry4) you assume that time=zero coincides with the first sample Fred
Reply by ●October 29, 20042004-10-29
If your working with a received signal, remember the phase lag might be greater than 2*pi. Use a low frequency signal also to check that the time delay is the same as the one you calculated for your original samples.
Reply by ●October 29, 20042004-10-29
Fred Marshall wrote:> "Jerry Avins" <jya@ieee.org> wrote in message > news:2ucs33F25fm19U1@uni-berlin.de... > >>Fred Marshall wrote: >> >>All well and good, but phase lag with what reference? >> >>Jerry > > > 4) you assume that time=zero coincides with the first sample > > FredYou assume that. I might agree to. What does Canby assume? Your solution via simultaneous equations works fine. Another way is a 5-point DFT. That assumes that "5 samples per cycle" is an accurate statement. We used to do 12-point DFTs by formula, using waveforms derived graphically from tube characteristics, to estimate the distortion in open-loop push-pull Class-B plate modulators. Symmetry canceled even harmonics, so six coefficients were enough. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●October 29, 20042004-10-29
"Barry" <bg_ie@yahoo.com> wrote in message news:731cea69.0410290459.11ed2656@posting.google.com...> If your working with a received signal, remember the phase lag might > be greater than 2*pi. Use a low frequency signal also to check that > the time delay is the same as the one you calculated for your original > samples.Barry, I suppose we could get into a big philosophical discussion about this - but certainly agree anyway. The term "phase lag" is a little problematic for me even though the term was (is?) in common use on controls engineering. Generally the term was applied to compensation networks as in "phase lag network" or "phase lead network" or more simply (and more appropriately "lead network" or "lag network"). There was also the use of the term "transportation lag" by Truxal which referred to a pure delay - which I think is much more to your point. And, of course a designed lead or lag network might intentionally introduce phase change of greater than 2*pi - so the delay is known - but starting from a set of samples is a different situation more akin to the phase unwrapping problem. In a signal processing context, phase and delay are interrelated of course but delay itself tends to be ambiguous with respect to phase while phase is not at all ambiguous with respect to delay. (That is, you can compute phase from delay but often not delay from phase). Thus our attempts to "unwrap" phase. It's interesting to ask why this might be. One perspective is that phase is only defined (as a single value) at a single frequency. In theory, it takes infinite time to determine (integrate) as reflected in the Fourier Transform. So, with infinite time there is no question of transportation lag and time=0 is a defined point. Then we only have a phase reference - "what is this sinusoid's relative position at time zero?" So, the question was: "what is the phase lag"? I took this to mean "what is the phase?" Once the phase is known (as above) then the transportation lag for a particular system may be included if it's known. However, from a simple set of samples you can't know because a simple set of samples doesn't tell you anything about the absolute time reference. So, your point is well taken while beyond the scope of what can be done with the data given taken unto itself. The idea of using a lower frequency for resolving delay ambiguity is a good one! Of course it pushes on the signal to noise ratio requirement (as does solving simultaneous equations) and you have to know that the delay is not greater than 2*pi at *that* frequency too! Fred
Reply by ●October 29, 20042004-10-29
"Jerry Avins" <jya@ieee.org> wrote in message news:2uf58cF25i21qU1@uni-berlin.de...> Fred Marshall wrote: > >> "Jerry Avins" <jya@ieee.org> wrote in message >> news:2ucs33F25fm19U1@uni-berlin.de... >> >>>Fred Marshall wrote: >>> >>>All well and good, but phase lag with what reference? >>> >>>Jerry >> >> >> 4) you assume that time=zero coincides with the first sample >> >> Fred > > You assume that. I might agree to. What does Canby assume? > > Your solution via simultaneous equations works fine. Another way is a > 5-point DFT. That assumes that "5 samples per cycle" is an accurate > statement. > > We used to do 12-point DFTs by formula, using waveforms derived > graphically from tube characteristics, to estimate the distortion in > open-loop push-pull Class-B plate modulators. Symmetry canceled even > harmonics, so six coefficients were enough.Jerry, Gee, I should have been a tiny bit more complete. I said: "4) you assume that time=zero coincides with the first sample (well, actually this isn't necessary as long as you plug in the right values of time in wt below)" So, Canby has to assume whatever time reference is appropriate for the situation. But, I repeat myself.... Yeah, you'd have to do a Fourier Series for a distorted waveform.... I once used a Taylor series in order to generate an analytical expression for distortion components of a 4-quadrant, matched amplifier, analog multiplier - made it easier to ponder the multiplier characteristics regarding amplifier matching requirements. Fred
Reply by ●November 1, 20042004-11-01
Thanks for your replies. When I outputted a 160Hz cosine signal from my adc, i got a signal back with a phase delay of -1.001005801. These are the results for integer multiples of 160Hz. 640Hz -1.001005801 480Hz -1.537704946 320Hz -2.022511457 160Hz -2.434791904 Does this sound right? If you plot this it is linear, but I actually expected the 160Hz lag to be half that of the 320Hz signal. "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<DaednS8JiKqP5R_cRVn-sg@centurytel.net>...> "Jerry Avins" <jya@ieee.org> wrote in message > news:2uf58cF25i21qU1@uni-berlin.de... > > Fred Marshall wrote: > > > >> "Jerry Avins" <jya@ieee.org> wrote in message > >> news:2ucs33F25fm19U1@uni-berlin.de... > >> > >>>Fred Marshall wrote: > >>> > >>>All well and good, but phase lag with what reference? > >>> > >>>Jerry > >> > >> > >> 4) you assume that time=zero coincides with the first sample > >> > >> Fred > > > > You assume that. I might agree to. What does Canby assume? > > > > Your solution via simultaneous equations works fine. Another way is a > > 5-point DFT. That assumes that "5 samples per cycle" is an accurate > > statement. > > > > We used to do 12-point DFTs by formula, using waveforms derived > > graphically from tube characteristics, to estimate the distortion in > > open-loop push-pull Class-B plate modulators. Symmetry canceled even > > harmonics, so six coefficients were enough. > > Jerry, > > Gee, I should have been a tiny bit more complete. I said: > > "4) you assume that time=zero coincides with the first sample > (well, actually this isn't necessary as long as you plug in the right values > of time in wt below)" > > So, Canby has to assume whatever time reference is appropriate for the > situation. But, I repeat myself.... > > Yeah, you'd have to do a Fourier Series for a distorted waveform.... I once > used a Taylor series in order to generate an analytical expression for > distortion components of a 4-quadrant, matched amplifier, analog > multiplier - made it easier to ponder the multiplier characteristics > regarding amplifier matching requirements. > > Fred






