Talk:Instantaneous phase and frequency

THIS PAGE HAS BEEN IDENTIFIED AS CONTAINING DUBIOUS CONTENT
''' —Preceding unsigned comment added by Bowelsifter (talk • contribs) 04:08, 7 December 2008 (UTC)

KYN says "Please be more specific about what's wrong with the application section rather than removing it."

It either needs more detail or it needs to go out, because neither of the articles it references, image processing and computer vision, corroborate the claim that is made.


 * More details perhaps, but I don't understand the argument that this article needs to be corroborated by the computer vision or image processing articles to stay. These articles provide overviews of larger application areas and do not mention specific techniques for solving problems.  Please refer to the books by Cohen or Granlund & Knutsson for more substantial support.


 * Sorry, I did not realize those references corroborate the article content. But I will happily take your word for it.
 * --Bob K 22:30, 27 June 2007 (UTC)

Also, if it stays, someone needs to make the change I already indicated; i.e., the maxima occur at $$\phi(t) = {\pi \over 2} + N\cdot 2 \pi,$$ and the minima occur at  $$\phi(t) = -{\pi \over 2} + N\cdot 2 \pi,$$  for integer values of N.   And the points of maximum slope are the multiples of $$\pi.\,$$  But why are we reiterating this mundane detail about sin functions here? Easier and better to link them to sinusoid, where they can see for themselves on a graph.


 * This confusion was introduced by you own edits on 2006-06-28T01:55:27. Prior to that, there was no explicit reference to a sin function.  The instantaneous phase is defined as the argument of the analytic signal, and it does equal 0 at the local maxima of either a sin and a cos function!!


 * I see what you mean. I had actually forgotten that bit of history.
 * But I still don't agree with the part of your comment that I emboldened. sin(0)=0.
 * --Bob K 22:30, 27 June 2007 (UTC)


 * A reference to the sinusoid article is OK, BUT one of the main points of the instantaneous phase is that, because it is defined from the analytic representation, it is well-defined for (almost) any signal (at least when the corresponding analytic signal is non-zero).

--Bob K 18:00, 27 June 2007 (UTC)

I would like to revert to the 2006-03-27T08:53:15 version. It provides the following information:


 * The formal definition in the first paragraph (The current version suggests that the instantaneous phase must be related to a sin function. This is not correct)
 * A discussion on the representation since the argument function of a complex function can be represented in different ways (this is relevant for various applications which use the instantaneous phase in practice)
 * A summary of the motivation for using phase in computer vision (here one could add a reference to instantaneous frequency, which is derived from the instantaneous phase).

Yes/No? --KYN 20:46, 27 June 2007 (UTC)


 * Wikipedia is killing me right now. I lost edits about 6 times already, just trying to "preview".  Also, I'm packing for a trip and need to finish and get some sleep.  So do what you think is best, and maybe we will reconnect here some time in the future.  Please think about the fact that analytic signals aren't the only things with an instantaneous phase.  Even the moon has one.  As best I can recall, that was the original reason to trying to "generalize" to other kinds of things.
 * --Bob K 22:38, 27 June 2007 (UTC)

In order to solve this issue we need to agree on what instantaneous phase means. Clearly, phase has a very broad meaning which can be seen in the Phase article. However, the concept instantaneous phase has a very precise meaning related to an (in principle) arbitrary function or signal, it is the argument of the corresponding analytic signal. It offers two interesting properties which are relevant in signal processing:


 * It provides a useful definition of phase for functions/signals which are not of cos/sin-type, even though this phase value may not be meaningful in all cases.


 * This phase value is independent of the reference coordinate (e.g. time) used for defining a specific signal, such as cos(t) or sin(t). Instead the instantaneous phase is only dependent of the local variation of the signal.  For example, it assumes the value 0 at the maximal points of both cos and sin functions.

To see that the last statement is true: f(t)=cos(t) gives the corresponding analytic signal $$ e^{i t} $$ and the instantaneous phase is $$ \phi = t + 2 \pi N $$, assuming that N is chosen such that $$ \phi $$ lies in the range $$ [0, 2 \pi [ $$. Clearly, the value of $$ \phi $$ is 0 at the maximal values of f. Now, set f(t)=sin(t) which gives the corresponding analytic signal $$ -i e^{i t} = e^{i (t - \frac{\pi}{2})} $$. The instantaneous phase is $$ \phi = t - \frac{\pi}{2} + 2 \pi N $$. The maximal values of sin(t) happens when $$ t = \frac{\pi}{2} + 2 \pi M $$, i.e., when $$ \phi = 0 + 2 \pi (N+M) $$. Again, this gives $$ \phi = 0 $$ at the local maxima.

My intention with this article is to describe this particular instantaneous phase. The other phase-related concepts should be in the Phase disambiguation page, but the earlier version of this article was missing a link to that page. --KYN 20:11, 1 July 2007 (UTC)

Why does Phase Unwrapping end up here?
Phase unwrapping is an interesting problem which has oodles of both potential and realized algorithms.

Why is it a redirect to this article, which contains almost zero information on phase unwrapping algorithms? cojoco (talk) 04:16, 3 January 2008 (UTC)


 * When someone writes the article you envision, it will replace the redirect.
 * --Bob K (talk) 05:23, 3 January 2008 (UTC)

Frequency measurement
Could someone add this info:

For calculating the frequency of the incoming sampled analytic signal, a complex autocorrelation function Sk(n)is often employed. Sk(n) = Ik(n)+jQk(n) is calcualted by considering two samples in the neighbourhood. Thus, Ik(n) = 0.5(I(n)I(n-1) + Q(n)Q(n-1)+I(n-1)I(n-2)+Q(n-1)Q(n-2)) Qk(n) = 0.5(Q(n)I(n-1) -I(n)Q(n-1)+Q(n-1)I(n-2)-I(n-1)Q(n-2)) Phase incursion, deltaPhi = arctan(Qk(n)/Ik(n)) deltaPhi = 2*pi*f*samplingPeriod Thus frequency f,               f = arctan(Qk(n)/Ik(n)) / (2 *pi*samplingPeriod)

Ramashray (talk) 09:46, 1 April 2009 (UTC)


 * If my reverse engineering is correct, a more heuristic description of that would be:
 * Compute two consecutive phase changes, Δφ(n)=φ(n)-φ(n-1)  and  Δφ(n-1).
 * Convert them to vectors, weighted by the amplitudes of two samples: $$\scriptstyle A_n\ e^{j\Delta \phi(n)}$$ and $$\scriptstyle A_{n-2}\ e^{j\Delta \phi(n-1)}.$$
 * Add the vectors, extract the phase argument, convert radians to equivalent in Hz.
 * So it includes a bit of lowpass filtering (averaging), which could be done in other ways. Why is this the preferred method?
 * --Bob K (talk) 16:40, 7 February 2012 (UTC)

Focus of the article
I'm not sure that I like the focus suggested by the title Instantaneous phase. I would like to edit an article that deals with the triplet instantaneous amplitude, instantaneous phase, instantaneous frequency. Motivation: (Naoki Saito & Jimena Royo Letelier, Presentation: Amplitude and Phase Factorization of Signals via Blaschke Product and Its Applications, March 9, 2009, jsiam09.pdf). In fact a merge with Analytic signal might be in order if all those definitions are related to that. Some of this has also landed at Hilbert transform. Opinions? Olli Niemitalo (talk) 07:22, 28 January 2012 (UTC)


 * The article used to be better but was quickly reverted back to a form more congruent to what the article's creator had in mind. Pedagogically, that was a bad move.  We should start with the meanings of instantaneous phase and instantaneous frequency from the perspective of a simple, real sinusoid and after that extend the meaning to the those same parameters derived from the analytic signal.  This article is dreadfully confusing now and has succeeded at confusing someone referring to the concept in another article. 70.109.178.133 (talk) 03:43, 29 January 2012 (UTC)


 * Do the sinusoidal signals $$x(t) = \ \sin(\omega t + \phi)\,$$ and $$y(t) = a\ \cos(\omega t + \phi)\,$$ have the same instantaneous phase $$\omega t + \phi\,$$? What I'm actually asking is, does the instantaneous phase depend on the way the equation is written, or only on the signal as such. Olli Niemitalo (talk) 06:37, 29 January 2012 (UTC)


 * (Mathematics of the Discrete Fourier Transform (DFT), with Audio Applications --- Second Edition, by Julius O. Smith III, W3K Publishing, 2007, ISBN 978-0-9745607-4-8.) defines instantaneous phase of a sinusoid written using $$sin\,$$ as the argument of $$sin\,$$. This can be interpreted as yes.


 * A vast body of literature derives instantaneous phase from the analytic signal, in which case the answer would be no. Olli Niemitalo (talk) 08:41, 29 January 2012 (UTC)


 * (BTW, I dunno if I'm indenting the way you want, Olli, I just want my indentation to be different than the person I am responding to.) Anyway, like any other concept of phase, instantaneous phase is always relative to a reference.  If sin(ωt) is your reference, then the instantaneous phase of B sin(ωt+φ) is ωt+φ and the instantaneous phase of A cos(ωt+φ) is ωt+φ-π/2.  But sometimes the reference signal is a quadrature signal, where the reference signal is the pair: cos(ωt) & sin(ωt).  So if your detected signal is A cos(ωt+φ), it depends on which of the quadrature pair you're comparing to.  Of course, we electrical engineers like to do this quadrature thing elegantly and define a compound and complex reference signal as cos(ωt) + i sin(ωt) = eiωt and then, I think, it should be pretty obvious what the phase (instantaneous or not) of ei(ωt+φ) is.
 * That doesn't sound correct. Relative to the reference signal sin(ωt), wouldn't the instantaneous phase of signal B sin(ωt+φ) then be ωt+φ - ωt = φ? Olli Niemitalo (talk) 06:48, 30 January 2012 (UTC)
 * One reason I have been trying to differentiate between the semantics of "phase" and "angle" was that I generally like to think that "phase" is a relative thing. But I don't know anyone who says "instantaneous angle".  "Instantaneous phase" is this time-varying thing that has ωt  I don't know how better to say it.  Perhaps: "Relative to the reference signal sin(ωt), then the instantaneous phase is relative to sin(0).  I dunno. 71.169.181.58 (talk) 19:00, 30 January 2012 (UTC)
 * Perhaps for instantaneous phase the concept of a reference signal is invalid, and rather, instantaneous phase of a sinusoidal signal is the argument of the chosen sinusoidal function (by convention cos, but could be for example sin if so indicated) in an equation that defines the sinusoidal signal as A s(ωt+φ), where A is a positive amplitude, s is the chosen sinusoidal function, ω is a positive frequency, t is time and φ is the phase offset. Olli Niemitalo (talk) 10:53, 31 January 2012 (UTC)
 * Nonetheless the instantaneous frequency is clear in any case because it is the derivative w.r.t. t of that argument and a constant that is slipped in there (or omitted) will not change that value.
 * I would suggest doing what User:Bob K did, but use cos instead of sin to be more compatible with the reference (real) sinusoid that you will find in the lit, which is the real part of eiωt. When the signal is expressed as a real sinusoid, then the instantaneous frequency is simply and always the time derivative of the stuff inside the argument.  But when the signal is expressed as some arbitrary x(t) (like it's data coming into a DSP process), then to extract the amplitude and frequency of x(t), you have to do this analytic signal stuff, then take the time derivative of the arg{ } of it.  And then, there are some nice formulae we can use to avoid the issue of phase unwrapping, but this phase unwrapping is a necessary pedagogical topic.  It's just that when you really compute the instantaneous frequency of some arbitrary IF signal, you don't do it by calculating the principal value of the arg{ } and then adding or subtracting integer multiples of 2π to that arg to unwrap.  You might do that in MATLAB, but not in an FM receiver.
 * Hi. I followed your link to refresh my memory, and it appears I did use cos instead of sin back in '06.  --Bob K (talk) 15:01, 2 February 2012 (UTC)
 * You used sin and someone else changed it to cos and then the whole thing got reverted back to the analytic signal. cos is better, especially when this gets extended to the analytic signal.  An electrical engineer would be aware of that, but many other persons would not be. 70.109.180.116 (talk) 05:23, 3 February 2012 (UTC)
 * While this arg{ } of analytic signal definition is necessary for completeness, for pedagogical reasons, it shouldn't be the way the article starts. The instantaneous phase of a real sinusoid is simply the argument that the sin or cos function operates on and the instantaneous frequency (or frequency in general) is simply the derivative of that.  That is the way the article should start.  Then we get into the analytic signal and the arg{ }.  I think this should be pedagogically obvious. 71.169.181.58 (talk) 18:34, 29 January 2012 (UTC)
 * Or, we could start with a generic periodic function $$s(x)\,$$ such that $$s(x + 2\pi) = s(x)\,$$ for all $$x\,$$ to avoid any cause of confusion in the beginning. The period of $$2\pi\,$$ would be just to make the transition to sinusoids painless. (In short: Reply to comments, not persons. Indent one deeper than the comment you reply to. Put your reply under earlier replies to the same comment. outdent if got ridiculously deep.) Olli Niemitalo (talk) 22:52, 29 January 2012 (UTC)
 * I think we should keep it sinusoidal, just to keep it as simple as possible. I haven't heard from User:KYN nor User:Bob K.  There are some other people that might be interested in what happens to this article.  I wonder what they might be thinking. 71.169.181.58 (talk) 02:15, 30 January 2012 (UTC)


 * Difficult to have a say on this since it is still unclear to me in what direction the proposed changes are going, but why not have a go at it since there just now seems to be a number of people interested in the article. --KYN (talk) 20:06, 30 January 2012 (UTC)
 * I just want to scoot this back, pedagogically, to start with a real sinusoid, essentially to define instantaneous frequency in terms of the derivative of the argument of the sinusoidal function. The rate of change of that real value is the most basic definition of what frequency of a sinusoid is.  Then extend the concept to a sorta arbitrary x(t), which requires computing the analytic signal xa(t).
 * I'll give it a poke and see if you approve, K. 71.169.181.58 (talk) 03:05, 31 January 2012 (UTC)
 * Go for it! --Bob K (talk) 17:59, 1 February 2012 (UTC)
 * I don't have time now to finish this. I'll plop it here for you to look at and adjust:

In signal processing, a sinusoidal signal of a given constant frequency, f (or angular frequency, ω), and constant amplitude, A is:


 * $$ x(t) = A \cdot \cos\left(\omega t + \phi \right) = A \cdot \cos\left(2 \pi f t + \phi \right) \ $$

If the frequency is non-negative, f≥0, the angle argument to the sinusoidal function, cos is an increasing function and the rate of increase is ω (radians per second) or 2πf. φ is the initial angle of a sinusoidal function at its origin and is sometimes called phase offset.

The quantity ωt+φ, the entire angle argument to the sinusoidal function is the instantaneous phase of the sinusoid. Independent of the value of the phase offset, φ, the rate of increase or derivative of the instantaneous phase is the instantaneous frequency, in this case ω expressed as an angular frequency (rad/sec) or f expressed as ordinary frequency (Hz).

If the sinusoidal function is generalized a bit more but with same constant amplitude, A:


 * $$ x(t) = A \cdot \cos\left( \theta(t) \right) \ $$

θ(t) is time-varying angle argument and the instantaneous phase. Likewise, the rate of increase (derivative w.r.t.] t or time) of the instantaneous phase is the instantaneous frequency:


 * $$ \omega(t) = \theta^\prime(t) = \frac{d \theta(t)}{dt} $$   (angular frequency, rad/sec)


 * $$ f(t) = \frac{\omega(t)}{2 \pi} = \frac{1}{2 \pi}\theta^\prime(t) $$   (ordinary frequency, Hz)

This expression of frequency need not be constant and allows for time variance of frequency where the frequency at the instant of time t is f(t). This allows for a concept and well-defined expression of changing frequency at every time t without requiring entire cycles to be completed to give that definition of frequency meaning. There is meaning to the rate of cycles per second of sinusoidal oscillation, even at a short instance of time when no entire cycle of the sinusoid is completed.

Just as with any phase measurement or definition, the exact value of instantaneous phase is relative to a reference origin and depends on how the reference is defined. As an example, if the reference sinusoid is


 * $$u(t) = \sin(\omega t) \ $$

the instantaneous phase of the sinusoid


 * $$ x(t) = A \sin\left(\omega t + \phi \right) $$

is
 * $$ \theta(t) = \omega t + \phi . \ $$

But if the reference is


 * $$u(t) = \cos(\omega t) = \sin\left(\omega t + \begin{matrix} \frac{\pi}{2} \end{matrix}\right) \ $$

then the instantaneous phase for the same x(t) is
 * $$ \theta(t) = \omega t + \phi - \begin{matrix} \frac{\pi}{2} \end{matrix} . \ $$

The definition and expression of the instantaneous phase of a sinusoid can differ only by a constant phase offset term (in this case π/2) depending on what reference the sinusoid is taken to be relative to. Since two functions that differ only by a constant must have the same derivative, then in either case the instantaneous frequency (as well as constant frequency) is unambiguously:


 * $$ \omega(t) = \theta^\prime(t) = \omega . $$   (angular frequency, rad/sec)

Similarly the instantaneous frequency, in general, depends only on the angle argument of the sinusoidal function and does not depend on the reference or any constant phase offset term (such as φ or π/2) in the argument.

Phase unwrapping
Because the sin(x) or cos(x) functions are periodic with period 2π, adding an integer multiple of 2π to the argument of the sinusoidal function does not change its value. That means that adding different multiples of 2π to the instantaneous phase does not change how the sin or cos function evaluate that angle at any instant. Because of this, when considering a general sinusoidal signal


 * $$ x(t) = A \cdot \cos\left( \theta(t) \right) \ $$

the instantaneous phase is ambiguously determined and, given different definitions or methods, can have any integer multiple of 2π added to θ(t) and remain equally valid. If fact, the integer multiple can vary with t as long as it remains an integer.


 * $$ x(t) = A \cdot \cos\left( \theta(t) - 2 \pi N(t) \right) \ $$

where N(t) is always an integer, but may vary with t.

Some methods that determine the phase of a sinuosoid will always result in the principal value of the phase which means


 * $$ -\pi < \Theta(t) \le +\pi \,$$

or alternatively
 * $$ 0 \le \Theta(t) < 2 \pi . \,$$

This makes no difference when the sinusoidal function is evaluated, but may present problems when the instantaneous frequency is considered. Consider


 * $$ x(t) = A \cdot \cos\left( \omega t + \phi \right) \,$$,

the instantaneous phase is ostensibly


 * $$\theta(t) = \omega t + \phi \,$$,

but the principal value of the angle argument is


 * $$ \begin{align}

\Theta(t) &= (\omega t + \phi) \mod \ 2\pi \\ &= (\omega t + \phi) - 2 \pi N(t) \\ &= \theta(t) - 2 \pi N(t) \\ \end{align} $$

where mod is the Modulo_operation and N(t) is whatever integer is necessary to add to θ(t) so that the sum Θ(t) is the principal value and always lies in the range 0 ≤ Θ < 2π. If the instantaneous phase is expressed as the principal value Θ(t), this is called phase wrapping or wrapped phase because the angle function appears to have been wrapped around a pole with a discontinuity everywhere the phase jumps from 2π to 0 (or from -π to +π).

While this does not change the value of the sinusoid x(t), it does have implications for the instantaneous frequency, ω at various times t. Differentiating the principal angle value Θ(t) against t will likely result in spurious spikes in the instantaneous frequency which are not representative of the true frequency and are not desired. To avoid this problem the principle angle value Θ(t) is unwrapped by adding 2πN(t) which results in the unwrapped phase, θ(t) which is continuous, and a constant and valid instantaneous frequency ω.

This operation is called phase unwrapping and there exist functions in mathematical computation software, such as MATLAB, to perform such an operation. If, in the wrapped phase Θ(t), a jump upward of greater than π is detected, N is decreased by 1, and if a jump downward more than -π is detected, then N is increased by 1.


 * Hmmmm... seems OK for an undergrad textbook, but a bit verbose for an encyclopedia article. I still prefer the more concise '06 version.  And the phase unwrapping explanation is not illuminating.  The current one is quite correct, in practice, except that it leaves the discrete-time implementation to the readers' imagination.  And regarding the analytic signal section, I still think, as I did in '06, that it is already adequately covered in that article.
 * --Bob K (talk) 03:23, 3 February 2012 (UTC)
 * What is one person's verbosity is another's rigor. Trying to get the basic definition in, deal with differences in phase, depending on the reference signal, show that it doesn't make any difference for the instantaneous frequency, put in where phase wrapping and unwrapping come from, since there is no other article for this important concept (it also matters with phase part of frequency response) and then show how the analytic signal generalizes it.  I certainly don't think it's done, but I'll have to leave it for a week.
 * BTW, we could use a diagram of wrapped and unwrapped phase on the same graph. Being an IP, I can't upload it.  Would you be interested in such?  I think a simple ωt for unwrapped phase and (ωt)mod_2π for wrapped phase would be good enough.  I dunno. 70.109.180.116 (talk) 05:23, 3 February 2012 (UTC)
 * As in '06, I am not passionate about this article. I gladly defer to those who are.  I agree that a diagram is needed, and I will give that some thought.  But what does "being an IP" mean?  Just curious. --Bob K (talk)
 * It just means that Wikipedia editors that have not created an account (or, at least, are not signed in) cannot upload pics. I might find some more time to develop this.  I would like to try to write everything, edit and condense, and make a decent "narrative", and then find the sources for verifiability. 70.109.185.188 (talk) 22:49, 3 February 2012 (UTC)


 * --Bob K (talk) 05:46, 3 February 2012 (UTC)

Analytic signal

 * Here we will generalize to a signal that does not have an explicit sinusoidal form and extend the above definitions to it. This is where we get to the concepts of instantaneous phase and instantaneous frequency as it is introduced in the article at present.

Inadequate lede template
The chosen template asserts: "This article's introduction section may not adequately summarize its contents." FWIW, the introduction appears adequate to me. --Bob K (talk) 19:04, 19 October 2013 (UTC)


 * Maybe instantaneous phase and instantaneous frequency are important in applications other than signal processing? Constant314 (talk) 19:59, 20 October 2013 (UTC)

separate things
This is a fine article in many cases, but it complicates things when one wants to consider just phase or just frequency. This comes up in Analog television, where (at least for US NTSC) chrominance is described by phase, and audio by FM, and so frequency. We can't describe them separately, linking to this article! Gah4 (talk) 20:56, 6 April 2023 (UTC)