Elements of Frequency-domain Analysis
Frequency-domain analysis is a commonly used technique in signal processing. For example, in heart rate variation (HRV) analysis, high frequency (HF) and low frequency (LF) components are usually extracted from RR intervals based on power spectral analysis. As an industrial engineering, I am not familiar with this area, but I need this tool in my research. Although a lot of open-source software/libraries are available, I think it still necessary to understand what is going on. Therefore, I spent some time in frequency-domain analysis and make a little summary here.
2. Fourier Transform
Fourier transform is the basis of frequency-domain analysis. Fourier transform maps a signal from time domain to frequency domain. There are four kinds of Fourier transforms:
- Fourier series:
- Discrete-time Fourier transform:
- Continuous-time Fourier transform:
- Discrete Fourier transform:
Each kind of Fourier transform has its inverse Fourier transform, which reconstruct the original signal based on the frequency components.
Take Fourier series as an example. It can be shown that any periodic function can be represented as linear combination of and , where is the period of , i.e. for any , and are integers,
Here and are real numbers. According to Euler's formula
where , then we get
Now is represented by a linear combination of , and are the coefficients (complex numbers), is integer. Recall the Euler's formula, has period or frequency . Thus has been discomposited into combination of components in different frequency! It can be shown that the coefficient can be calculated as
This equation is Fourier series. Therefore, Fourier series calculates the coefficients for each frequency component. And the previous equation is inverse Fourier series, which reconstruct the original time-domain signal based on the coefficients of frequency components.
Other kinds of Fourier transforms are similar. And the characteristics of each Fourier transform are listed in the following table.
|Time domain||Frequency domain|
|Discrete-time Fourier transform||discrete||nonperiodic||continuous||periodic|
|Continuous-time Fourier transform||continuous||nonperiodic||continuous||nonperiodic|
|Discrete Fourier transform||discrete||periodic||discrete||periodic|
For example, Fourier series takes a continuous periodic function as input, and produces discrete non-periodic coefficients as output. The table shows something interesting. Discrete in one domain always related to periodic in the other domain, while continuous in one domain always related to nonperiodic in the other domain.
Since digital signals are stored in discrete values in computer, discrete-time Fourier transform (DTFT) and discrete Fourier transform (DFT) are more commonly used. DTFT takes discrete nonperiodic signal as input, and produces its frequency components as continuous periodic series. DFT takes discrete periodic signal as input, and produces its frequency components as a discrete periodic signal. If some conditions are satisfied, e.g. , fast Fourier transform (FFT) algorithms can be employed to calculate DFT efficiently.
Fourier transform can be considered from the point of view function basis and kernel method, which is the concern of my another article.
There are other transforms such as z-transform and Laplace transform. They have very similar form with Fourier transform. For example, in z-transform
Here is a complex number. Let
we get DTFT.
3. Energy Spectrum and Power Spectrum
Energy spectrum is defined as the energy on a specific frequency
If we sum up or integrate the energy spectrum over for Fourier series and continuous Fourier series, and over for DFT and DTFT, we can get the total energy.
However, sometimes a signal does not have Fourier transform (continuous Fourier transform or DTFT), i.e. go to infinity, we define power spectrum as the divided by the integral interval of Fourier transform.
Here applies Fourier transform to over at frequency . It can be shown that can be calculated as the Fourier transform of
4. Stationary Stochastic Process
Until now we are talking about deterministic signals, i.e. is a specific function of . Sometimes it is necessary to consider stochastic process, i.e. is a random variable. Here I use subscript to distinguish stochastic process from deterministic signal.
For a stochastic process , if the correlation between any two variables depends only on the difference in time
for any , and the expected value is certain
The stochastic process is weakly stationary or wide-sense stationary (WSS).
For WSS process, we cannot apply Fourier transform to the original series directly since they are random numbers. But we can apply Fourier transform to its autocorrelation function . Recall Section 3,
is the autocorrelation for WSS process with zero mean and variance 1 (for other WSS process, it will be proportional). The resulting value
is the power spectrum.
5. Power Spectrum Estimation
Power spectrum is calculated as the Fourier transform of the autocorrelation function (ACF). However, in practice, the series is usually not infinite, and we rarely know the true ACF. Thus we need to estimate power spectrum. There are two categories of methods for power spectrum estimation: non-parametric method and parametric method.
In non-parametric method, ACF is estimated directly by data. Periodogram is a non-parametric estimation, where
here is the length of the signal. It is equivalent to the ACF of an infinite series where when and for other .
In parametric method, a model, e.g. autoregressive moving average (ARMA) model, is fitted at first. Then the ACF can be calculated.
6. Some Comments
The constraint in power spectrum analysis is that the process should be stationary. However, in a lot of situations, this assumption is not satisfied. Furthermore, power spectrum analysis need a long series of data to obtain good estimation. Therefore, maybe state-space model is a better choice in a number of situations.
For more information
About ARMA model:
- Cryer, J. D., & Chan, K. S. (2008). Time series analysis: with applications in R. Springer.
About Fourier transform:
About power spectrum:
- Hayes, M. H. (2009). Statistical digital signal processing and modeling. John Wiley & Sons.