Harmonic analysis vs. Spectral analysis  (Part 3 of 4)
Part of the splash screen of HBK's Perception product

Harmonic analysis vs. Spectral analysis (Part 3 of 4)

Using spectral analysis on periodic signals

In Part 1 and Part 2 of this article we discussed harmonic analysis and spectral analysis. Harmonic analysis performs Fourier analysis over an integer number of periods of periodic signals. Spectral analysis is normally done on non-periodic signals using a fixed-duration analysis interval.

For harmonic analysis, the duration of the analysis interval should be changed if the frequency of the signal changes to keep exactly an integer number of periods in your analysis interval. Consequently, harmonic analysis requires from the Fourier transform the flexibility to deal with any duration of the analysis interval. As those things normally go, we will somehow have to pay for this flexibility: for harmonic analysis we will have to use the Discrete Fourier Transform (DFT) whereas for spectral analysis it is common to use the Fast Fourier Transform (FFT). The FFT provides the same functionality as the DFT but requires significantly less CPU time. This is due, however, to its limitation that it only works with certain fixed analysis interval durations so, at least in principle, it cannot be used for harmonic analysis.

The following question then arises: what happens if we perform spectral analysis on periodic signals? That is, we choose a fixed duration for the analysis interval without considering the period of the signal such that we will not have an integer number of periods in our analysis interval. This would, after all, save us significant computation time because we can use the much faster FFT. Can we somehow still get the exact harmonics of the period signal?

This is illustrated in the picture below. Again, the time signal is a single sine signal, so the signal is periodic and contains only a single frequency. For the analysis interval, we choose a duration not equal to an integer number of periods. The resulting spectrum is also given in the picture below. Perhaps contrary to expectations, we see several frequency components while clearly the time signal contains only one frequency component. Furthermore, the actual frequency component of the sine signal (indicated in red) is not present in the spectrum. The strongest frequency component is close but not at the location of the actual frequency component. So why is this happening?

No alt text provided for this image

This phenomenon is known as spectral leakage: the energy in the actual frequency component (the harmonic) is leaked to other frequencies. Furthermore, the location of strongest frequency component is not equal to the harmonic frequency, and its amplitude is lower than the amplitude of the harmonic because some of the energy is in other frequency components. So why do we get additional frequency components while obviously, our time signal contains only a single frequency? The reason is that the Fourier transform, by decomposing the signal in sine and cosine signals that cover all time, implicitly assumes that the analysis interval contains exactly one or more periods of the signal, and thus we are in fact analyzing a periodic signal that is an infinite repetition of the signal in the analysis interval, and this is not a sine signal, as is shown in the picture below. You may also observe that the period of this signal is longer than the period of the original sine signal i.e., it has a lower frequency, corresponding to the frequency of the strongest component in the spectrum (see picture above).

No alt text provided for this image

Spectral leakage can be mitigated using time-domain windowing (see previous episode of this article). Those bell-shaped windowing functions reduce the signal at either end of the analysis interval thus reducing the sharp edges and attenuating higher frequency components, but the spectral leakage cannot be completely eliminated, and the fact that the real frequency is not present in the spectrum remains. This means that spectral analysis will not give you exactly the real harmonics of your periodic signal.

Now that we have explained the differences between harmonic and spectral analysis using very simple time signals, it is time we move to signals as they appear in practical situations, like the output of an inverter in an electric drive train. This will be the subject of the next and last episode of this article.

#EPT #HBK

To view or add a comment, sign in

More articles by Tom Kevenaar

Insights from the community

Others also viewed

Explore topics