### Instantaneous frequency

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



\phi(t) = \arg[x(t)].\,   (See arg function.)

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



\phi(t) = \mathrm{arg}[ s_\mathrm{a}(t)] .\,[1]

When $\phi\left(t\right)\,$ is constrained to its principal value, either the interval (-π, π]  or  [0, 2π),  it is called the wrapped phase.  Otherwise it is called unwrapped, which is a continuous function of argument $t,\,$ assuming $s_\mathrm\left\{a\right\}\,$ is a continuous function of  $t.\,$  Unless otherwise indicated, the continuous form should be inferred.

## Examples

Example 1:  $s\left(t\right) = A\cdot \cos\left(\omega t + \theta\right),\,$  where $A\,$ and $\omega\,$ are positive values.


s_\mathrm{a}(t) = A\cdot e^{i (\omega t +\theta)} \,

$\phi\left(t\right) = \omega t + \theta\,$
In this simple sinusoidal, mono-frequency example, the constant $\theta\,$ is also commonly referred to as phase or phase offset.  $\phi\left(t\right)\,$ is a function of time.  $\theta\,$ 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.  $\phi\left(t\right)\,$ is unambiguously defined.
Example 2:  $s\left(t\right) = A\cdot \sin\left(\omega t\right) = A\cdot \cos\left\left(\omega t -\begin\left\{matrix\right\} \frac\left\{\pi\right\}\left\{2\right\}\end\left\{matrix\right\}\right\right)\,$


s_\mathrm{a}(t) = A\cdot e^{i \left(\omega t -\begin{matrix} \frac{\pi}{2}\end{matrix}\right)} \,

$\phi\left(t\right) = \omega t -\begin\left\{matrix\right\} \frac\left\{\pi \right\}\left\{2\right\}\end\left\{matrix\right\}\,$

In both examples the local maxima of  $s\left(t\right)\,$  correspond to  $\phi\left(t\right) = N\cdot 2\pi,\,$  for integer values of N. This has applications in the field of computer vision.

## Instantaneous frequency

In general, the instantaneous angular frequency is defined as

$\omega\left(t\right) = \phi^\prime\left(t\right) = \left\{d \over dt\right\} \phi\left(t\right),\,$
and the instantaneous frequency (Hz) is:
$f\left(t\right) = \frac\left\{1\right\}\left\{2 \pi\right\} \phi^\prime\left(t\right).$.

The inverse operation is:

 $\phi\left(t\right) = 2 \pi \int_\left\{-\infty\right\}^\left\{t\right\} f\left(\tau\right)\, d \tau \$ $= 2 \pi \int_\left\{-\infty\right\}^\left\{0\right\} f\left(t\right)\, dt + 2 \pi \int_\left\{0\right\}^\left\{t\right\} f\left(\tau\right)\, d \tau$ $= \phi\left(0\right) + 2 \pi \int_\left\{0\right\}^\left\{t\right\} f\left(\tau\right)\, d \tau.$

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

$\phi\left(nT\right) \ = \ \phi\left(\left(n-1\right)T\right) + 2\pi T f\left(nT\right) \ = \ \phi\left(\left(n-1\right)T\right) + \underbrace\left\{\arg\left(s_a\left(nT\right)\right) - \arg\left(s_a\left(\left(n-1\right)T\right)\right)\right\}_\left\{\Delta \phi\left(nT\right)\right\}.\,$

Discontinuities can then be removed by adding 2π whenever  $\scriptstyle \Delta \phi\left(nT\right) \ \le \ -\pi$  and subtracing 2π whenever  $\scriptstyle \Delta \phi\left(nT\right) \ > \ \pi.$ That allows $\scriptstyle \phi\left(nT\right)$ to accumulate without limit and produces an unwrapped instantaneous phase.[1]  An equivalent formulation that replaces the modulo 2π operation with a complex multiplication is:

$\phi\left(nT\right) \ = \ \phi\left(\left(n-1\right)T\right) + \arg\left(s_a\left(nT\right)\cdot s_a^*\left(\left(n-1\right)T\right)\right),\,$   where the asterisk denotes complex conjugate.

## 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:

 $e^\left\{i \phi\left(t\right)\right\}\,$ s_\mathrm{a}(t)|}\, $= \cos\left(\phi\left(t\right)\right) + i\cdot \sin\left(\phi\left(t\right)\right).\,$     (Euler's formula)

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.