# Instantaneous phase and frequency

Instantaneous phase and frequency are important concepts in signal processing that occur in the context of the representation and analysis of time-varying functions.[1] The instantaneous phase (also known as local phase or simply phase) of a complex-valued function s(t), is the real-valued function:

${\displaystyle \varphi (t)=\arg\{s(t)\},}$

where arg is the complex argument function. The instantaneous frequency is the temporal rate of the instantaneous phase.

And for a real-valued function s(t), it is determined from the function's analytic representation, sa(t):[2]

{\displaystyle {\begin{aligned}\varphi (t)&=\arg\{s_{\mathrm {a} }(t)\}\\[4pt]&=\arg\{s(t)+j{\hat {s}}(t)\}.\end{aligned}}}

When φ(t) is constrained to its principal value, either the interval (−ππ] or [0, 2π), it is called wrapped phase. Otherwise it is called unwrapped phase, which is a continuous function of argument t, assuming sa(t) is a continuous function of t. Unless otherwise indicated, the continuous form should be inferred.

Instantaneous phase vs time.

## Examples

### Example 1

${\displaystyle s(t)=A\cos(\omega t+\theta ),}$

where ω > 0.

${\displaystyle s_{\mathrm {a} }(t)=Ae^{j(\omega t+\theta )},}$
${\displaystyle \varphi (t)=\omega t+\theta .}$

In this simple sinusoidal example, the constant θ is also commonly referred to as phase or phase offset. φ(t) is a function of time; θ is not. In the next example, we also see that the phase offset of a real-valued sinusoid is ambiguous unless a reference (sin or cos) is specified. φ(t) is unambiguously defined.

### Example 2

${\displaystyle s(t)=A\sin(\omega t)=A\cos(\omega t-\pi /2),}$

where ω > 0.

${\displaystyle s_{\mathrm {a} }(t)=Ae^{j(\omega t-\pi /2)},}$
${\displaystyle \varphi (t)=\omega t-\pi /2.}$

In both examples the local maxima of s(t) correspond to φ(t) = 2πN for integer values of N. This has applications in the field of computer vision.

## Instantaneous frequency

Instantaneous angular frequency is defined as:

${\displaystyle \omega (t)={\frac {d\varphi (t)}{dt}},}$

and instantaneous (ordinary) frequency is defined as:

{\displaystyle {\begin{aligned}f(t)&={\tfrac {1}{2\pi }}\omega (t)\\[4pt]&={\tfrac {1}{2\pi }}{\frac {d\varphi (t)}{dt}}\end{aligned}}}

where φ(t) must be the unwrapped instantaneous phase angle. If φ(t) is wrapped, discontinuities in φ(t) will result in Dirac delta impulses in f(t).

The inverse operation, which always unwraps phase, is:

{\displaystyle {\begin{aligned}\varphi (t)&=\int _{-\infty }^{t}\omega (\tau )\,d\tau =2\pi \int _{-\infty }^{t}f(\tau )\,d\tau \\[5pt]&=\int _{-\infty }^{0}\omega (\tau )\,d\tau +\int _{0}^{t}\omega (\tau )\,d\tau \\[5pt]&=\varphi (0)+\int _{0}^{t}\omega (\tau )\,d\tau .\end{aligned}}}

This instantaneous frequency, ω(t), can be derived directly from the real and imaginary parts of sa(t), instead of the complex arg without concern of phase unwrapping.

{\displaystyle {\begin{aligned}\varphi (t)&=\arg\{s_{\mathrm {a} }(t)\}\\[4pt]&=\operatorname {atan2} (\Im \{s_{\mathrm {a} }(t)\},\Re \{s_{\mathrm {a} }(t)\})+2m_{1}\pi \\[4pt]&=\arctan \left({\frac {\Im \{s_{\mathrm {a} }(t)\}}{\Re \{s_{\mathrm {a} }(t)\}}}\right)+m_{2}\pi \end{aligned}}}

2m1π and m2π are the integer multiples of π necessary to add to unwrap the phase. At values of time, t, where there is no change to integer m2, the derivative of φ(t) is

{\displaystyle {\begin{aligned}\omega (t)&={\frac {d\varphi (t)}{dt}}\\&={\frac {d}{dt}}\arctan \left({\frac {\Im \{s_{\mathrm {a} }(t)\}}{\Re \{s_{\mathrm {a} }(t)\}}}\right)\\\\&={\frac {1}{1+\left({\frac {\Im \{s_{\mathrm {a} }(t)\}}{\Re \{s_{\mathrm {a} }(t)\}}}\right)^{2}}}{\frac {d}{dt}}\left({\frac {\Im \{s_{\mathrm {a} }(t)\}}{\Re \{s_{\mathrm {a} }(t)\}}}\right)\\\\&={\frac {\Re \{s_{\mathrm {a} }(t)\}{\frac {d\Im \{s_{\mathrm {a} }(t)\}}{dt}}-\Im \{s_{\mathrm {a} }(t)\}{\frac {d\Re \{s_{\mathrm {a} }(t)\}}{dt}}}{(\Re \{s_{\mathrm {a} }(t)\})^{2}+(\Im \{s_{\mathrm {a} }(t)\})^{2}}}\\\\&={\frac {1}{|s_{\mathrm {a} }(t)|^{2}}}\left(\Re \{s_{\mathrm {a} }(t)\}{\frac {d\Im \{s_{\mathrm {a} }(t)\}}{dt}}-\Im \{s_{\mathrm {a} }(t)\}{\frac {d\Re \{s_{\mathrm {a} }(t)\}}{dt}}\right)\\&={\frac {1}{(s(t))^{2}+(({\hat {s}}(t))^{2}}}\left(s(t){\frac {d{\hat {s}}(t)}{dt}}-{\hat {s}}(t){\frac {ds(t)}{dt}}\right)\end{aligned}}}

For discrete-time functions, this can be written as a recursion:

${\displaystyle \varphi [n]=\varphi [n-1]+\omega [n]=\varphi [n-1]+\underbrace {\arg\{s_{\mathrm {a} }[n]\}-\arg\{s_{\mathrm {a} }[n-1]\}} _{\Delta \varphi [n]}.}$

Discontinuities can then be removed by adding 2π whenever Δφ[n] ≤ −π, and subtracting 2π whenever Δφ[n] > π. That allows φ[n] to accumulate without limit and produces an unwrapped instantaneous phase. An equivalent formulation that replaces the modulo 2π operation with a complex multiplication is:

${\displaystyle \varphi [n]=\varphi [n-1]+\arg\{s_{\mathrm {a} }[n]\,s_{\mathrm {a} }^{*}[n-1]\},}$

where the asterisk denotes complex conjugate. The discrete-time instantaneous frequency (in units of radians per sample) is simply the advancement of phase for that sample

${\displaystyle \omega [n]=\arg\{s_{\mathrm {a} }[n]\,s_{\mathrm {a} }^{*}[n-1]\}.}$

## Complex representation

In some applications, such as averaging the values of phase at several moments of time, it may be useful to convert each value to a complex number, or vector representation:[3]

{\displaystyle {\begin{aligned}e^{i\varphi (t)}&={\frac {s_{\mathrm {a} }(t)}{|s_{\mathrm {a} }(t)|}}\\[4pt]&=\cos(\varphi (t))+i\sin(\varphi (t)).\end{aligned}}}

This representation is similar to the wrapped phase representation in that it does not distinguish between multiples of 2π in the phase, but similar to the unwrapped phase representation since it is continuous. A vector-average phase can be obtained as the arg of the sum of the complex numbers without concern about wrap-around.

## References

1. ^ Sejdic, E.; Djurovic, I.; Stankovic, L. (August 2008). "Quantitative Performance Analysis of Scalogram as Instantaneous Frequency Estimator". IEEE Transactions on Signal Processing. 56 (8): 3837–3845. doi:10.1109/TSP.2008.924856. ISSN 1053-587X.
2. ^ Blackledge, Jonathan M. (2006). Digital Signal Processing: Mathematical and Computational Methods, Software Development and Applications (2 ed.). Woodhead Publishing. p. 134. ISBN 1904275265.
3. ^ Wang, S. (2014). "An Improved Quality Guided Phase Unwrapping Method and Its Applications to MRI". Progress in Electromagnetics Research-PIER. 145: 273–286.