DFT of arbitrary analogue signals

Performing a Fourier Transform of an arbitrary analogue signal is not at all that simple. Soon you will find yourself back in unsurveyable calculational work. In those cases you might get a quick overview in a roundabout way by digitalisation of the signal and excecuting a Discrete Fourier Transform (DFT). After all that is the way computers do it.

An example

picure of a sawtooth wave

How about the amplitudes of the fundamental wave and the harmonics of such a sawtooth formed signal?

fundamental and harmonics Because this is a periodic signal it consists of a fundamental wave with frequency:

f = 1/T

and harmonics with frequencies 2f, 3f, 4f etc.

So it is sufficient to look at just one cycle of the input signal G(t), as well as to one cycle of the fundamental, and two respectively three cycles (and so on) of the harmonics.

For the Fourier Transform we have to observe the cosines as well. If you do so you will see that, in this case of the sawtooth signal, after multiplication and integration (see later) the results will be always zero. The cosines don't contribute in this case.

Left you see the original signal and the sine of the fundamental having frequency f and the sines of the second and third harmonic.

Fourier Transform

To calculate the amplitude of the different components we have to multiply the original wave form point by point with the sines of the fundamental and the harmonics. For our sawtooth signal this is going to look more or less like this:
multiplied with fundamental Here we see the sawtooth multiplied with the sine of the fundamental wave. A somewhat strange form. Mirrored it is something like:

x . sin(x)

of which the surface below the line must be estimated (integrated).
multiplied with 2nd harmonic And this is how it looks for the second harmonic with frequency 2f.

Of course the surface below the 0-line must be subtracted, but we see already that the result will be more than zero.
multiplied with 3th harmonic And this the the third harmonic with frequency 3f.

Here as well the result will be more than zero.

Digitalisation and the DFT

In order to get a jolly good idea without integration and evaluation of goniometric formulas, we can just like computers are used to do, follow the digital (numeric) way. A sensible choice looks to be to use a sampling frequency of 12 times the fundamental frequency.
sampled sawtooth Sampling with 12f implies that no higher frequencies may be present in the signal than 6f. They are surely there, seeing the very sharp edges, but we leave it for this moment.

We should be aware that we can't calculate higher harmonics than 6f. If we want to do so, we have to take a higher sampling frequency, e.g. 24f or 48f or even higher. Using the PC this is not at all a problem, but for calculating "by hand" this is quite too much work.
sampled fundamental Of course we have to sample the sines of the fundamental and the harmonics as well. Here you see the fundamental:
sin(30°), sin(60°), sin(90°) enz.

Be aware: the vertical scale is stretched in respect to the sawtooth.
multiply point by point Both sampled wave forms are multiplied sample by sample.

Here you see what you get.
Integration degrades to addition:

2,5 + 3,4 + 3 + 1,7 + 0,5 + 0 + 0,5 + 1,7 + 3 + 3,4 + 2,5 = 22,2

That simple is the DFT ...... Even computers can do it.

The harmonics

The harmonics are done in the same way. Do the calculations yourself, it is a usefull exercise. The results are:
10,2 for the second harmonic and
6 for the third harmonic.

Inacuracies and evaluation

Because harmonics higher than half the sampling frequency are abundant present in the sawtooth the result is not too accurate. Besides this we rounded the sine values, which influences the results as well. Choosing more samples, so a higher sampling frequency, and do more precise calculating this is getting better and better.

The precise results should have been:
24 for the fundamental,
12 for the second harmonic,
8 for the third harmonic.
The ratios are: 1 : 1/2 : 1/3 etc.

Not bad for such a rough estimation.

As a check: the reversed process

Curious on where we went wrong? Then we are going to see how the wave form looks alike if we filter away the harmonics of 6f and higher.
harmonics 1 to 5 The wobbling line is the fundamental including harmonics 2 to 5.

Left we see it projected on top of the sawtooth and it wobbles nicely around it.

Right we see the samples as we took them from the sawtooth. There are quite some abberations visible.

In fact we should have taken the samples from the wobbling line.
Because we didn't do so we are punnished now by the harmonics 7 and higher of the sawtooth, which "fold back" and contribute (the so called Aliasses), positive or negative, to the calculated values of the fundamental and the harmonics 2 to 5. So that is the reason of the deviations in the calculated values by DFT.