DSPRelated.com
Forums

Total phase of a sum of complex numbers

Started by Rune Allnor December 18, 2003
Hi all. 

I am working with this problem that involves modelling the total 
phase of a signal, i.e the phase can take on any value and is not 
restricted to the interval [0, 2pi>.

Part of the analysis involves a reflection sequence on the form 

           Q
   r(n) = sum A_q*d(n-m_q)
          q=0

where d(n) is the Dirac delta sequence. Z transforming the 
Dirac delta gives

   D_(0)(k) = Z{d(n)} = 1

and z transforming the shifted Dirac delta

   D_(m_q)(k) = Z{d(n-m_q)} = z^(-m_q)

which translates to some phase shift in frequency domain. 

Now, how should I compute the total phase in the z transform of r(n)?
I can't think of a way that does not include summing the real and 
imaginary parts of the z transforms of the shifted delta's, which 
means that the overall phase must be computed with the atan (atan2) 
function, which in turn means that the overall phase becomes 
available modulo 2pi. Which is not what I want.

Can it be done at all?

Rune
allnor@tele.ntnu.no (Rune Allnor) writes:

> I am working with this problem that involves modelling the total > phase of a signal, i.e the phase can take on any value and is not > restricted to the interval [0, 2pi>. > > Part of the analysis involves a reflection sequence on the form > > Q > r(n) = sum A_q*d(n-m_q) > q=0 > > where d(n) is the Dirac delta sequence. Z transforming the > Dirac delta
Z-transforming the _Dirac_ delta? I'd z-transform a Kronecker delta sequence, but probably not a Dirac delta sequence.
> gives > > D_(0)(k) = Z{d(n)} = 1 > > and z transforming the shifted Dirac delta > > D_(m_q)(k) = Z{d(n-m_q)} = z^(-m_q) > > which translates to some phase shift in frequency domain.
Only if m_q is an integer. If m_q is not an integer, you could end up with a sampled, delayed sinc() function.
> Now, how should I compute the total phase in the z transform of r(n)? > I can't think of a way that does not include summing the real and > imaginary parts of the z transforms of the shifted delta's, which > means that the overall phase must be computed with the atan (atan2) > function, which in turn means that the overall phase becomes > available modulo 2pi. Which is not what I want. > > Can it be done at all?
Usually the phase is calcualted [-pi,pi) (or [0,2pi)) and then unwrapped to give the "total" phase. Can you explain a little more about why you want the total phase? Ciao, Peter K. -- Peter J. Kootsookos "I will ignore all ideas for new works [..], the invention of which has reached its limits and for whose improvement I see no further hope." - Julius Frontinus, c. AD 84
p.kootsookos@remove.ieee.org (Peter J. Kootsookos) wrote in message news:<s683cbi3fbl.fsf@mango.itee.uq.edu.au>...
> allnor@tele.ntnu.no (Rune Allnor) writes: > > > I am working with this problem that involves modelling the total > > phase of a signal, i.e the phase can take on any value and is not > > restricted to the interval [0, 2pi>. > > > > Part of the analysis involves a reflection sequence on the form > > > > Q > > r(n) = sum A_q*d(n-m_q) > > q=0 > > > > where d(n) is the Dirac delta sequence. Z transforming the > > Dirac delta > > Z-transforming the _Dirac_ delta? I'd z-transform a Kronecker delta sequence, > but probably not a Dirac delta sequence.
Eh... yes, you're right...
> > gives > > > > D_(0)(k) = Z{d(n)} = 1 > > > > and z transforming the shifted Dirac delta > > > > D_(m_q)(k) = Z{d(n-m_q)} = z^(-m_q) > > > > which translates to some phase shift in frequency domain. > > Only if m_q is an integer. If m_q is not an integer, you could end up > with a sampled, delayed sinc() function. > > > Now, how should I compute the total phase in the z transform of r(n)? > > I can't think of a way that does not include summing the real and > > imaginary parts of the z transforms of the shifted delta's, which > > means that the overall phase must be computed with the atan (atan2) > > function, which in turn means that the overall phase becomes > > available modulo 2pi. Which is not what I want. > > > > Can it be done at all? > > Usually the phase is calcualted [-pi,pi) (or [0,2pi)) and then > unwrapped to give the "total" phase. > > Can you explain a little more about why you want the total phase?
I'm testing out various ideas that rely on the unwrapped phase. The problem is that the various unwrapping schemes apparently have their deficiencies, so I'd like a synthetic reference where I know the "true" answer (total phase), and then test the unwrapping schemes with respect to this reference. Rune
Rune Allnor wrote:

   ...

> I'm testing out various ideas that rely on the unwrapped phase. > The problem is that the various unwrapping schemes apparently > have their deficiencies, so I'd like a synthetic reference where > I know the "true" answer (total phase), and then test the unwrapping > schemes with respect to this reference. > > Rune
Continuous functions produce continuous phase, and that is enough information to allow an unwrapping scheme to produce unerring results. Unwrapping schemes break down in the presence of noise or undersampling. Since you intend to compute your reference signal, there should be no problem unwrapping it. Are you too pessimistic, or am I too naive? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins <jya@ieee.org> wrote in message news:<3fe1c1a8$0$4743$61fed72c@news.rcn.com>...
> Rune Allnor wrote: > > ... > > > I'm testing out various ideas that rely on the unwrapped phase. > > The problem is that the various unwrapping schemes apparently > > have their deficiencies, so I'd like a synthetic reference where > > I know the "true" answer (total phase), and then test the unwrapping > > schemes with respect to this reference. > > > > Rune > > Continuous functions produce continuous phase, and that is enough > information to allow an unwrapping scheme to produce unerring results. > Unwrapping schemes break down in the presence of noise or undersampling. > Since you intend to compute your reference signal, there should be no > problem unwrapping it. Are you too pessimistic, or am I too naive? > > Jerry
I'm probably too pessimistic. But then, I hate to use the very tool I am about to check, to produce the reference data. It's one omre of those irrational idiosyncracies of mine. Rune
allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0312172018.771ab537@posting.google.com>...
> Hi all. > > I am working with this problem that involves modelling the total > phase of a signal, i.e the phase can take on any value and is not > restricted to the interval [0, 2pi>. > > Part of the analysis involves a reflection sequence on the form > > Q > r(n) = sum A_q*d(n-m_q) > q=0 > > where d(n) is the Dirac delta sequence. Z transforming the > Dirac delta gives > > D_(0)(k) = Z{d(n)} = 1 > > and z transforming the shifted Dirac delta > > D_(m_q)(k) = Z{d(n-m_q)} = z^(-m_q) > > which translates to some phase shift in frequency domain. > > Now, how should I compute the total phase in the z transform of r(n)? > I can't think of a way that does not include summing the real and > imaginary parts of the z transforms of the shifted delta's, which > means that the overall phase must be computed with the atan (atan2) > function, which in turn means that the overall phase becomes > available modulo 2pi. Which is not what I want. > > Can it be done at all? > > Rune
BTW, I have come up with a possible way of finding the total phase of the spectrum of the sequence above: If the sequence is regarded as the impulse response of a FIR filter, I can compute the zeros of that transfer function and use the geometrical method for computing the magnitude and phase responses. The only problem is that the sequence may be a few hundred (or perhaps a couple of thousand) samples long... which raises all kinds of questions about running time ans numerical accuracy of root-search routines... Does anyone know of any "trick" to be able to compute the roots of a polynomial of order, say, 1000 that provides accurate results? Rune
allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0312172018.771ab537@posting.google.com>...
> Hi all. > > I am working with this problem that involves modelling the total > phase of a signal, i.e the phase can take on any value and is not > restricted to the interval [0, 2pi>. > > Part of the analysis involves a reflection sequence on the form > > Q > r(n) = sum A_q*d(n-m_q) > q=0 > > where d(n) is the Dirac delta sequence. Z transforming the > Dirac delta gives > > D_(0)(k) = Z{d(n)} = 1 > > and z transforming the shifted Dirac delta > > D_(m_q)(k) = Z{d(n-m_q)} = z^(-m_q) > > which translates to some phase shift in frequency domain. > > Now, how should I compute the total phase in the z transform of r(n)? > I can't think of a way that does not include summing the real and > imaginary parts of the z transforms of the shifted delta's, which > means that the overall phase must be computed with the atan (atan2) > function, which in turn means that the overall phase becomes > available modulo 2pi. Which is not what I want. > > Can it be done at all? > > Rune
BTW, I have come up with a possible way of finding the total phase of the spectrum of the sequence above: If the sequence is regarded as the impulse response of a FIR filter, I can compute the zeros of that transfer function and use the geometrical method for computing the magnitude and phase responses. The only problem is that the sequence may be a few hundred (or perhaps a couple of thousand) samples long... which raises all kinds of questions about running time ans numerical accuracy of root-search routines... Does anyone know of any "trick" to be able to compute the roots of a polynomial of order, say, 1000 that provides accurate results? Rune
>>>>> "Rune" == Rune Allnor <allnor@tele.ntnu.no> writes:
Rune> Does anyone know of any "trick" to be able to compute the roots of a Rune> polynomial of order, say, 1000 that provides accurate results? I don't think there is any trick, other than to use extra precision---a lot of extra precision. The classic example is the 20th-order polynomial whose roots are the integers 1 to 20. I think most (all?) root-finding algorithms will produce some (complex) roots that aren't even really close to the known roots. I think this is because the small perturbations in the coefficients cause large changes in the roots. And there's not much you can do about it. Ray
Jerry Avins <jya@ieee.org> wrote in message news:<3fe1c1a8$0$4743$61fed72c@news.rcn.com>...
> Are you too pessimistic, or am I too naive? > > Jerry
Bah, this is just ridiculous! I can sum the numbers directly in polar format, it just takes a bit more book keeping with the phase in the accumulator. I'm disturbingly slow these days, it must be the dark season (~4 hours of daylight per day, no sun at all) that's getting to me. Rune
Rune Allnor wrote:
> allnor@tele.ntnu.no (Rune Allnor) wrote in message news:<f56893ae.0312172018.771ab537@posting.google.com>... > >>Hi all. >> >>I am working with this problem that involves modelling the total >>phase of a signal, i.e the phase can take on any value and is not >>restricted to the interval [0, 2pi>. >> >>Part of the analysis involves a reflection sequence on the form >> >> Q >> r(n) = sum A_q*d(n-m_q) >> q=0 >> >>where d(n) is the Dirac delta sequence. Z transforming the >>Dirac delta gives >> >> D_(0)(k) = Z{d(n)} = 1 >> >>and z transforming the shifted Dirac delta >> >> D_(m_q)(k) = Z{d(n-m_q)} = z^(-m_q) >> >>which translates to some phase shift in frequency domain. >> >>Now, how should I compute the total phase in the z transform of r(n)? >>I can't think of a way that does not include summing the real and >>imaginary parts of the z transforms of the shifted delta's, which >>means that the overall phase must be computed with the atan (atan2) >>function, which in turn means that the overall phase becomes >>available modulo 2pi. Which is not what I want. >> >>Can it be done at all? >> >>Rune > > > BTW, I have come up with a possible way of finding the total phase of > the spectrum of the sequence above: If the sequence is regarded as > the impulse response of a FIR filter, I can compute the zeros of that > transfer function and use the geometrical method for computing the > magnitude and phase responses. > > The only problem is that the sequence may be a few hundred (or perhaps a > couple of thousand) samples long... which raises all kinds of questions > about running time ans numerical accuracy of root-search routines... > > Does anyone know of any "trick" to be able to compute the roots of a > polynomial of order, say, 1000 that provides accurate results? > > Rune
There's a great analog tool designed to do just that. It's called a Spirule. (I can't think where I put mine, but there must be literature that shows it.) I'm thinking that a digital model of an analog tool might speed the calculation. If I had it in my hand, I might get a firmer idea. (I used to "compute" logs of sines to two places by picturing my slide rule. After using it long enough, the scales become imprinted on one's retina. Alas, they've pretty well faded.) Look up Root locus by, I think, Walter Evans. You may find a picture. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;