Learning Content and Theses

Platform for digital learning at HSHL

Digital Frequency Analysis

Imagine a signal that consists of several sinusoidal waveforms of different frequencies. As an example, we take a signal with a high-frequency component of lower amplitude and a low-frequency component of higher amplitude. For how such a signal comes about, see Measurement technology: filters.

Superimposed signal of a component with high frequency and low amplitude and a component with low frequency and high amplitude
Zeit = time

The task is to determine the peak value, phase and frequency of the individual signal components. Suppose this signal is present as a voltage signal at the output of the sensor. In measurement technology you have learned how to amplify, shift and filter such a signal in analogue form so that it fits optimally into the input voltage range of an ADC. In the ADC the signal is digitised, and at the output it is available as a stream of numbers. The ADC outputs numbers at fixed time intervals, which are written into a memory, for example by a microcontroller.

To simplify the task, we first consider only a single sinusoidal signal. One period of a sinusoidal signal with 20 sampling points could look like this after being digitised by an 8-bit ADC:

Sampled sine period with 20 memory locations: table of the numerical values from 0 to 255 and plot against the memory location
Speicherstelle = memory location · Zahl = number · Zahlen = numbers

The numerical values lie in the range [0 .. 255]. It is a time-discrete and value-discrete signal. The signal in the figure above has, for example, a frequency of 1kHz and was sampled at 20 kSPS (fAbtast = 20kHz).

If the time t is increased continuously for a time-continuous signal, this corresponds, for a time-discrete signal, to a jump from one sample value to the next. We start at the value 255 at memory location 5. If we now look at the signal at a slightly later time, we take the value from memory location 6 (249). Instead of a voltage waveform U(t), we now speak of a number sequence Zahl(n). The running index n indicates where in the memory we currently are in the time sequence. Between the “times” n and n + 1 lies the period of the sampling frequency:

\[ T = \frac{1}{f_{\mathrm{Abtast}}} = \frac{1}{20\,\mathrm{kHz}} = 50\,\mathrm{\mu s} \]

The sequence of numbers in memory does not allow us to reconstruct the time interval at which the data were sampled. But since you know the sampling frequency at which the ADC you selected works, you know how long the time between two data points in the data stream was.

For sinusoidal signals, we are often interested in the parameters that describe the signal mathematically: peak value, frequency and phase.

You could determine the peak value by searching for the maximum and minimum of the signal in the data stream. There are ready-made algorithms for this.

You can determine the period – and from it the frequency – by detecting the zero crossings of the signal. The time between two zero crossings corresponds to half the period of the signal. If you count the number of sampling points between two zero crossings (10 in the example above), you know that this time corresponds to 10 periods of the sampling frequency of 50 µs each. The period of the signal is therefore TSignal = 20 ∙ TAbtast = 20 ∙ 50µs = 1 ms long. This gives the frequency fSignal = 1 / TSignal = 1 kHz.

The phase can only be determined if there is some reference. If, for example, two signals are considered, the phase can be determined from the time shift of the signals relative to each other. Or let us consider the current and voltage signals from the chapter Conductivity measurement . If these signals are shifted in time relative to each other, we can specify a phase shift between the signals. The phase relates the time shift to the period. So it does not express it in seconds, but as a kind of percentage of the period (only not related to 100 as with percent, but to 360° or 2π).

The signal processing methods presented have the disadvantage that they quickly reach their limits. Look again at the first figure on this page. Try to determine the maxima and minima or the zero crossings of both signals separately from the waveform. With several superimposed signals, this no longer works. That is why from now on we no longer work in the time domain, but in the frequency domain. .

Download course as PDF

The PDF contains all pages of the course. Interactive content is only available on the website.