Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Ads

Discussion Groups

Free Online Books

Discussion Groups | Comp.DSP | Establishing phase lag of sin signal

There are 12 messages in this thread.

You are currently looking at messages 0 to 10.


Establishing phase lag of sin signal - ?ine Canby - 13:03 28-10-04

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.

Re: Establishing phase lag of sin signal - Bhaskar Thiagarajan - 13:54 28-10-04



"?ine Canby" <a...@yahoo.com> wrote in message
news:5...@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.



Re: Establishing phase lag of sin signal - Fred Marshall - 14:01 28-10-04

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" <a...@yahoo.com> wrote in message 
news:5...@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 



Re: Establishing phase lag of sin signal - Jerry Avins - 14:28 28-10-04

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" <a...@yahoo.com> wrote in message 
> news:5...@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 

All well and good, but phase lag with what reference?

Jerry
-- 
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Re: Establishing phase lag of sin signal - Fred Marshall - 02:21 29-10-04

"Jerry Avins" <j...@ieee.org> wrote in message 
news:2...@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



Re: Establishing phase lag of sin signal - Barry - 08:59 29-10-04

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.

Re: Establishing phase lag of sin signal - Jerry Avins - 11:17 29-10-04

Fred Marshall wrote:

> "Jerry Avins" <j...@ieee.org> wrote in message 
> news:2...@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
-- 
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Re: Establishing phase lag of sin signal - Fred Marshall - 12:43 29-10-04

"Barry" <b...@yahoo.com> wrote in message 
news:7...@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





Re: Establishing phase lag of sin signal - Fred Marshall - 13:04 29-10-04

"Jerry Avins" <j...@ieee.org> wrote in message 
news:2...@uni-berlin.de...
> Fred Marshall wrote:
>
>> "Jerry Avins" <j...@ieee.org> wrote in message
>> news:2...@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 



Re: Establishing phase lag of sin signal - ?ine Canby - 18:11 01-11-04

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:<D...@centurytel.net>...
> "Jerry Avins" <j...@ieee.org> wrote in message 
> news:2...@uni-berlin.de...
> > Fred Marshall wrote:
> >
> >> "Jerry Avins" <j...@ieee.org> wrote in message
> >> news:2...@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

| 1 | 2 | next