Adaptive Fourier Analyzer

This is the companion page of the paper "Observer-Based Adaptive Fourier Analysis" by L. Sujbert, G. Simon, and G. Péceli.

Companion page address:


DFT is the basic algorithm for Fourier analysis, but provides unbiased estimate only if the sampling is coherent. Assuming DFT of N points, coherent sampling is assured only if fin = k*fs/N, where k is an integer number.

In most practical cases sampling cannot be synchronized to the signal's frequency thus coherent sampling cannot be provided. Non-coherent sampling results in picket-fence effect and leakage. Such phenomena can be reduced by windowing, but not completely suppressed. The problem is especially interesting if order analysis is to be performed.

Recently an observer-based structure to perform sliding discrete Fourier transform was reviewed in [1], based on the work of [2]. Similarly to the DFT, this Fourier Analyzer (FA) is able to reconstruct any coherently sampled, band-limited periodic signal but the reconstruction is not perfect for non-coherently sampled periodic signals. The observer is shown in Fig. 1.

Observer based Fourier Analyzer

Fig.1. The structure of the observer-based Fourier Analyzer (FA)

An extension of the FA is an observer-based algorithm that can be used for the analysis of non-coherently sampled periodic signals as well as for order tracking. To achieve this, only the so-called basis vectors of the DFT are to be substituted by another complex exponentials having the same fundamental frequency as the input signal. However, the appropriate basis function set calls for the estimation of the fundamental frequency of the input signal. The extended observer, called Adaptive Fourier Analyzer (AFA), is able to estimate both the fundamental frequency and the spectrum of the input signal simultaneously, as shown in Fig. 2.

Adaptive Fourier Analyzer

Fig.2. The structure of the observer-based Adaptive Fourier Analyzer (AFA). The resonator positions are shown by colored dots, with the corresponding amplitude estimates having the same color. In the illustration the input signal contains 1st, 3rd, 5th, and 7th harmonics; the corresponding colors are red, green, purple, and orange, respectively.

AFA has been first proposed in [3], as an application of nonlinear signal processing. Later the observer has been extended for the error-free reconstruction of periodic signals of linear, logarithmic as well as hyperbolic time-frequency functions [4]. The paper introduces the design of the AFA in detail, provides tips and tricks for the practical implementation, addresses the stability issues, and compares it to other methods. The provided AFA implementation [afa.m] can be regarded as reference implementation, containing all aspects discussed in the paper.

MATLAB scripts

The MATLAB codes provided below help you to get more familiar with the AFA algorithm.

Use the graphical user interface [afagui.m] to experiment with AFA.

Should you wish to tweak more parameters, a command line option is also provided [afa.m] with a set of auxiliary files (input signal generators and a plotter).

The MATLAB codes can be downloaded in a zip file from here.

Graphical user interface

Adaptive Fourier Analyzer GUI

Fig.3. The Graphical User Interface with the plotted input and output signals

Command line option

If you want to use your own input signals, or want to tweak more parameters of the AFA, use the command line option.

Input signal generators

The sampling frequency is set to fs = 10 kHz in all cases.

All signal generator scripts produce their output to the current workspace. The outputs contain the signal itself (variable in), and other auxiliary variables to aid the presentation of the results in AFAplot.

AFA plotter

For sake of convenience, a plotter is provided, which plots the input signal and the output of the AFA. The plotter uses the variables produced by the signal generators along with the output of the AFA, using the name convention shown in section Usage.



Select a signal generator (e.g. the linearly sweeping sine wave [in_50_150_lin.m]). Type:

[frequency, fb_error, orders]=afa(in);

An example with more input parameters for the AFA (see help afa for more details):

[frequency, fb_error, orders] = afa(in, 'log', 1, 0.01, 256);

Note: If you want to use the provided AFAplot program, you must use the names shown in the examples as output parameters for AFA.


  1. Kollár, Zs., F. Plesznik, and S. Trumpf, ''Observer-Based Recursive Sliding Discrete Fourier Transform'', IEEE Signal Processing Magazine, vol. SPM-35 pp. 100-106, Nov. 2018.
  2. Péceli, G., ''A common structure for recursive discrete transforms'', IEEE Transactions on Circuits and Systems, vol. CAS-33 pp. 1035-36, Oct. 1986.
  3. Nagy, F., ''Measurement of signal parameters using nonlinear observers'' IEEE Transactions on Instrumentation and Measurement, vol. IM-41 pp. 152-155, Feb. 1992.
  4. Nagy, F., ''An adaptive Fourier analysis algorithm'' presented on the 5th International Conference on Signal Processing Applications and Technology, pp. 414-418, Oct. 18-21, 1994, Dallas.