# Spectral density estimation

(Redirected from Frequency estimation)
For the statistical concept, see probability density estimation.
For a broader coverage related to this topic, see Spectral density.

In statistical signal processing, the goal of spectral density estimation (SDE) is to estimate the spectral density (also known as the power spectral density) of a random signal from a sequence of time samples of the signal. Intuitively speaking, the spectral density characterizes the frequency content of the signal. One purpose of estimating the spectral density is to detect any periodicities in the data, by observing peaks at the frequencies corresponding to these periodicities.

SDE may assumes that a signal is composed of a limited (usually small) number of generating frequencies plus noise and seeks to find the location and intensity of the generated frequencies or may, alternatively, make no assumption on the number of components and seeks to estimate the whole generating spectrum.

## Overview

Example of voice waveform and its frequency spectrum
A triangle wave pictured in the time domain (top) and frequency domain (bottom). The fundamental frequency component is at 220 Hz (A2).

Spectrum analysis, also referred to as frequency domain analysis or spectral density estimation, is the technical process of decomposing a complex signal into simpler parts. As described above, many physical processes are best described as a sum of many individual frequency components. Any process that quantifies the various amounts (e.g. amplitudes, powers, intensities, or phases), versus frequency can be called spectrum analysis.

Spectrum analysis can be performed on the entire signal. Alternatively, a signal can be broken into short segments (sometimes called frames), and spectrum analysis may be applied to these individual segments. Periodic functions (such as ${\displaystyle \sin(t)}$) are particularly well-suited for this sub-division. General mathematical techniques for analyzing non-periodic functions fall into the category of Fourier analysis.

The Fourier transform of a function produces a frequency spectrum which contains all of the information about the original signal, but in a different form. This means that the original function can be completely reconstructed (synthesized) by an inverse Fourier transform. For perfect reconstruction, the spectrum analyzer must preserve both the amplitude and phase of each frequency component. These two pieces of information can be represented as a 2-dimensional vector, as a complex number, or as magnitude (amplitude) and phase in polar coordinates (i.e., as a phasor). A common technique in signal processing is to consider the squared amplitude, or power; in this case the resulting plot is referred to as a power spectrum.

In practice, nearly all software and electronic devices that generate frequency spectra apply a fast Fourier transform (FFT), which is a specific mathematical approximation to the full integral solution. Formally stated, the FFT is a method for computing the discrete Fourier transform of a sampled signal.

Because of reversibility, the Fourier transform is called a representation of the function, in terms of frequency instead of time; thus, it is a frequency domain representation. Linear operations that could be performed in the time domain have counterparts that can often be performed more easily in the frequency domain. Frequency analysis also simplifies the understanding and interpretation of the effects of various time-domain operations, both linear and non-linear. For instance, only non-linear or time-variant operations can create new frequencies in the frequency spectrum.

The Fourier transform of a stochastic (random) waveform (noise) is also random. Some kind of averaging is required in order to create a clear picture of the underlying frequency content (frequency distribution). Typically, the data is divided into time-segments of a chosen duration, and transforms are performed on each one. Then the magnitude or (usually) squared-magnitude components of the transforms are summed into an average transform. This is a very common operation performed on digitally sampled time-domain data, using the discrete Fourier transform. This type of processing is called Welch's method.[1] When the result is flat, it is commonly referred to as white noise. However, such processing techniques often reveal spectral content even among data which appears noisy in the time domain.

## Periodogram

Suppose that a signal is sampled at ${\displaystyle N}$ different times, with the samples uniformly spaced by ${\displaystyle \Delta t}$, giving values ${\displaystyle x_{n}}$. Since the power spectral density of a continuous function defined on the entire real line is the modulus squared of its Fourier transform, the simplest technique to estimate the spectrum is the periodogram, given by the modulus squared of the discrete Fourier transform,

${\displaystyle S(f)={\frac {\Delta t}{N}}\left|\sum _{n=0}^{N-1}x_{n}e^{-i2\pi n\Delta tf}\right|^{2},\qquad -{\frac {1}{2\Delta t}}

where ${\displaystyle 1/(2\Delta t)}$ is the Nyquist frequency. The name "periodogram" was coined by Arthur Schuster in 1898.[2]

Despite the simplicity of the periodogram, the method suffers from severe deficiencies. It is an inconsistent estimator, i.e., it does not converge to the true spectral density as ${\displaystyle N\rightarrow \infty }$.[3] It exhibits very high spectral leakage although this can be reduced by multiplying ${\displaystyle x_{n}}$ by a window function. In the presence of additive noise, the estimate has a positive bias.

## Techniques

Many different techniques for spectral estimation have been developed to overcome the problems of the naive periodogram. These techniques can generally be divided into non-parametric and parametric methods. The non-parametric approaches explicitly estimate the covariance or the spectrum of the process without assuming that the process has any particular structure. The periodogram itself is a non-parametric approach, and is essentially equivalent to the Fourier transform of the biased autocovariance convolved with a Fejér kernel. Some of the most common estimators in use for basic applications (e.g. Welch's method) are non-parametric estimators closely related to the periodogram. By contrast, the parametric approaches assume that the underlying stationary stochastic process has a certain structure which can be described using a small number of parameters (for example, using an auto-regressive or moving average model). In these approaches, the task is to estimate the parameters of the model that describes the stochastic process.

Following is a partial list of non-parametric spectral density estimation techniques:

Below is a partial list of parametric techniques:

### Parametric estimation

In parametric spectral estimation, one assumes that the signal is modeled by a stationary process which has a spectral density function (SDF) ${\displaystyle S(f;a_{1},\ldots ,a_{p})}$ that is a function of the frequency ${\displaystyle f}$ and ${\displaystyle p}$ parameters ${\displaystyle a_{1},\ldots ,a_{p}}$.[4] The estimation problem then becomes one of estimating these parameters.

The most common form of parametric SDF estimate uses as a model an autoregressive model ${\displaystyle AR(p)}$ of order ${\displaystyle p}$.[4]:392 A signal sequence ${\displaystyle \{Y_{t}\}}$ obeying a zero mean ${\displaystyle AR(p)}$ process satisfies the equation

${\displaystyle Y_{t}=\phi _{1}Y_{t-1}+\phi _{2}Y_{t-2}+\cdots +\phi _{p}Y_{t-p}+\epsilon _{t},}$

where the ${\displaystyle \phi _{1},\ldots ,\phi _{p}}$ are fixed coefficients and ${\displaystyle \epsilon _{t}}$ is a white noise process with zero mean and innovation variance ${\displaystyle \sigma _{p}^{2}}$. The SDF for this process is

${\displaystyle S(f;\phi _{1},\ldots ,\phi _{p},\sigma _{p}^{2})={\frac {\sigma _{p}^{2}\Delta t}{\left|1-\sum _{k=1}^{p}\phi _{k}e^{-2i\pi fk\Delta t}\right|^{2}}}\qquad |f|

with ${\displaystyle \Delta t}$ the sampling time interval and ${\displaystyle f_{N}}$ the Nyquist frequency.

There are a number of approaches to estimating the parameters ${\displaystyle \phi _{1},\ldots ,\phi _{p},\sigma _{p}^{2}}$ of the ${\displaystyle AR(p)}$ process and thus the spectral density:[4]:452-453

• The Yule-Walker estimators are found by recursively solving the Yule-Walker equations for an ${\displaystyle AR(p)}$ process
• The Burg estimators are found by treating the Yule-Walker equations as a form of ordinary least squares problem. The Burg estimators are generally considered superior to the Yule-Walker estimators.[4]:452 Burg associated these with maximum entropy spectral estimation.[5]
• The forward-backward least-squares estimators treat the ${\displaystyle AR(p)}$ process as a regression problem and solves that problem using forward-backward method. They are competitive with the Burg estimators.
• The maximum likelihood estimators assume the white noise is a Gaussian process and estimates the parameters using a maximum likelihood approach. This involves a nonlinear optimization and is more complex than the first three.

Alternative parametric methods include fitting to a moving average model (MA) and to a full autoregressive moving average model (ARMA).

## Frequency estimation

Frequency estimation is the process of estimating the complex frequency components of a signal in the presence of noise given assumptions about the number of the components.[6] This contrasts with the general methods above, which do not make prior assumptions about the components.

### Finite number of tones

A typical model for a signal ${\displaystyle x(n)}$ consists of a sum of ${\displaystyle p}$ complex exponentials in the presence of white noise, ${\displaystyle w(n)}$

${\displaystyle x(n)=\sum _{i=1}^{p}A_{i}e^{jn\omega _{i}}+w(n)}$.

The power spectral density of ${\displaystyle x(n)}$ is composed of ${\displaystyle p}$ impulse functions in addition to the spectral density function due to noise.

The most common methods for frequency estimation involve identifying the noise subspace to extract these components. These methods are based on eigen decomposition of the autocorrelation matrix into a signal subspace and a noise subspace. After these subspaces are identified, a frequency estimation function is used to find the component frequencies from the noise subspace. The most popular methods of noise subspace based frequency estimation are Pisarenko's method, the multiple signal classification (MUSIC) method, the eigenvector method, and the minimum norm method.

${\displaystyle {\hat {P}}_{PHD}(e^{j\omega })={\frac {1}{|\mathbf {e} ^{H}\mathbf {v} _{min}|^{2}}}}$
${\displaystyle {\hat {P}}_{MU}(e^{j\omega })={\frac {1}{\sum _{i=p+1}^{M}|\mathbf {e} ^{H}\mathbf {v} _{i}|^{2}}}}$,
• Eigenvector method
${\displaystyle {\hat {P}}_{EV}(e^{j\omega })={\frac {1}{\sum _{i=p+1}^{M}{\frac {1}{\lambda _{i}}}|\mathbf {e} ^{H}\mathbf {v} _{i}|^{2}}}}$
• Minimum norm method
${\displaystyle {\hat {P}}_{MN}(e^{j\omega })={\frac {1}{|\mathbf {e} ^{H}\mathbf {a} |^{2}}};\mathbf {a} =\lambda \mathbf {P} _{n}\mathbf {u} _{1}}$

### Single tone

If one only wants to estimate the single loudest frequency, one can use a pitch detection algorithm. If the dominant frequency changes over time, then the problem becomes the estimation of the instantaneous frequency as defined in the time–frequency representation. Methods for instantaneous frequency estimation include those based on the Wigner-Ville distribution and higher order ambiguity functions.[7]

If one wants to know all the (possibly complex) frequency components of a received signal (including transmitted signal and noise), one uses a discrete Fourier transform or some other Fourier-related transform.

## Example calculation

Suppose ${\displaystyle x_{n}}$, from ${\displaystyle n=0}$ to ${\displaystyle N-1}$ is a time series (discrete time) with zero mean. Suppose that it is a sum of a finite number of periodic components (all frequencies are positive):

{\displaystyle {\begin{aligned}x_{n}&=\sum _{k}A_{k}\cdot \sin(2\pi \nu _{k}n+\phi _{k})\\&=\sum _{k}\left(\overbrace {a_{k}} ^{A_{k}\sin(\phi _{k})}\cos(2\pi \nu _{k}n)+\overbrace {b_{k}} ^{A_{k}\cos(\phi _{k})}\sin(2\pi \nu _{k}n)\right)\end{aligned}}}

The variance of ${\displaystyle x_{n}}$ is, for a zero-mean function as above, given by ${\displaystyle {\frac {1}{N}}\sum _{n=0}^{N-1}x_{n}^{2}}$. If these data were samples taken from an electrical signal, this would be its average power (power is energy per unit time, so it is analogous to variance if energy is analogous to the amplitude squared).

Now, for simplicity, suppose the signal extends infinitely in time, so we pass to the limit as ${\displaystyle N\rightarrow \infty }$. If the average power is bounded, which is almost always the case in reality, then the following limit exists and is the variance of the data.

${\displaystyle \lim _{N\rightarrow \infty }{\frac {1}{N}}\sum _{n=0}^{N-1}x_{n}^{2}.}$

Again, for simplicity, we will pass to continuous time, and assume that the signal extends infinitely in time in both directions. Then these two formulas become

${\displaystyle x(t)=\sum _{k}A_{k}\cdot \sin(2\pi \nu _{k}t+\phi _{k})}$

and

${\displaystyle \lim _{T\rightarrow \infty }{\frac {1}{2T}}\int _{-T}^{T}x(t)^{2}dt.}$

The root mean square of ${\displaystyle \sin }$ is ${\displaystyle 1/{\sqrt {2}}}$, so the variance of ${\displaystyle A_{k}\sin(2\pi \nu _{k}t+\phi _{k})}$ is ${\displaystyle A_{k}^{2}/2}$. Hence, the contribution to the average power of ${\displaystyle x(t)}$ coming from the component with frequency ${\displaystyle \nu _{k}}$ is ${\displaystyle A_{k}^{2}/2.}$. All these contributions add up to the average power of ${\displaystyle x(t)}$.

Then the power as a function of frequency is ${\displaystyle A_{k}^{2}/2}$, and its statistical cumulative distribution function ${\displaystyle S(\nu )}$ will be

${\displaystyle S(\nu )=\sum _{k:\nu _{k}<\nu }A_{k}^{2}/2.}$

${\displaystyle S}$ is a step function, monotonically non-decreasing. Its jumps occur at the frequencies of the periodic components of ${\displaystyle x}$, and the value of each jump is the power or variance of that component.

The variance is the covariance of the data with itself. If we now consider the same data but with a lag of ${\displaystyle \tau }$, we can take the covariance of ${\displaystyle x(t)}$ with ${\displaystyle x(t+\tau )}$, and define this to be the autocorrelation function ${\displaystyle c}$ of the signal (or data) ${\displaystyle x}$:

${\displaystyle c(\tau )=\lim _{T\rightarrow \infty }{\frac {1}{2T}}\int _{-T}^{T}x(t)x(t+\tau )dt.}$

If it exists, it is an even function of ${\displaystyle \tau }$. If the average power is bounded, then ${\displaystyle c}$ exists everywhere, is finite, and is bounded by ${\displaystyle c(0)}$, which is the average power or variance of the data.

It can be shown that ${\displaystyle c}$ can be decomposed into periodic components with the same periods as ${\displaystyle x}$:

${\displaystyle c(\tau )=\sum _{k}{\frac {1}{2}}A_{k}^{2}\cos(2\pi \nu _{k}\tau ).}$

This is in fact the spectral decomposition of ${\displaystyle c}$ over the different frequencies, and is related to the distribution of power of ${\displaystyle x}$ over the frequencies: the amplitude of a frequency component of ${\displaystyle c}$ is its contribution to the average power of the signal.

The power spectrum of this example is not continuous, and therefore does not have a derivative, and therefore this signal does not have a power spectral density function. In general, the power spectrum will usually be the sum of two parts: a line spectrum such as in this example, which is not continuous and does not have a density function, and a residue, which is absolutely continuous and does have a density function.

## References

1. ^ Welch, P. D. (1967), "The use of Fast Fourier Transform for the estimation of power spectra: A method based on time averaging over short, modified periodograms", IEEE Transactions on Audio and Electroacoustics, AU-15 (2): 70–73, doi:10.1109/TAU.1967.1161901
2. ^ Schuster, A., "On the investigation of hidden periodicities with application to a supposed 26 day period of meteorological phenomena," Terrestrial Magnetism, 3, 13-41, 1898.
3. ^ Monson H. Hayes (1996). Statistical Digital Signal Processing and Modeling. John Wiley & Sons, Inc. p. 405. ISBN 0-471 59431-8.
4. ^ a b c d Donald B. Percival and Andrew T. Walden (1992). Spectral Analysis for Physical Applications. Cambridge University Press. ISBN 9780521435413.
5. ^ Burg, J.P. (1967) "Maximum Entropy Spectral Analysis", Proceedings of the 37th Meeting of the Society of Exploration Geophysicists, Oklahoma City, Oklahoma.
6. ^ Hayes, Monson H., Statistical Digital Signal Processing and Modeling, John Wiley & Sons, Inc., 1996. ISBN 0-471-59431-8.
7. ^ Lerga, Jonatan. "Overview of Signal Instantaneous Frequency Estimation Methods" (PDF). University of Rijeka. Retrieved 22 March 2014.