Fourier analysis has many applications, but this is topic is an introduction into Fourier analysis as it applies to signal processing.

Suppose that a complex signal x(t) is the sum of simple waves

$$x(t)=\sum_{n=0}^{N-1} A_n \, cos(2 \pi f_n (t-\tau_n))$$

with different amplitude A_{n}, frequency f_{n}, and phase τ_{n}. Using trigonometric identities we write

$$x(t)=\sum_{n=0}^{N-1} A_n \, cos(2 \pi f_n (t-\tau_n))$$ $$=\sum_{n=0}^{N-1}A_n \, cos(2 \pi f_n \tau_n) \, cos(2 \pi f_n t)+A_n \, sin(2 \pi f_n \tau_n) \, sin(2 \pi f_n t)$$ $$=\sum_{n=0}^{N-1}B_n \, cos(2 \pi f_n t)+C_n \, sin(2 \pi f_n t)$$

for some coefficients B_{n} = A_{n} cos(2π f_{n} τ_{n}) and C_{n} = A_{n} sin(2π f_{n} τ_{n}). Since cos(2π f_{n} t) and sin(2π f_{n} t) are the cosine and sine functions with zero phase, the phase of each simple wave in the signal x(t) is completely determined by the coefficients B_{n} and C_{n} and we can work without the phase τ_{n}.

## Orthogonal functions and the Fourier series

Sine and cosine functions of different frequencies are orthogonal for carefully chosen intervals and frequencies. If m and n are two different integer frequencies, then

$$\int_0^{2\pi} cos(m\,t) \, cos(n\,t) \, dt = \int_0^{2\pi} \frac{1}{2}(cos((m-n)t)+cos((m+n)t)) \, dt$$ $$=\frac{1}{2} (-\frac{sin(2\pi(m-n))-sin(0)}{m-n}-\frac{sin(2\pi(m_n))-sin(0)}{m+n})=0$$

Since m and n are integer and different, the expressions sin(2π (m – n)) and sin(2π (m + n)) evaluate to zero. We can similarly verify that two sine functions are orthogonal and that a sine and a cosine functions are orthogonal in the given interval for integer values of m and n.

The result is not the same for m = n. sin(m t) and cos(m t) are still orthogonal, but sin(m t) and sin(m t) are not, and cos(m t) and cos(m t) are not.

$$\int_0^{2\pi} cos(m\,t) \, cos(n\,t) \, dt = \int_0^{2\pi} \frac{1}{2}(cos((m-n)t)+cos((m+n)t)) \, dt$$ $$=\frac{1}{2} (2\pi-\frac{sin(4\pi\,m)-sin(0)}{m+n})=\pi$$

The sine and cosine functional form that we use above is not our only option. By substituting t with t 2π / T for some interval of time T, we can similarly show that the sine and cosine functions of the form

$$cos(\frac{2\pi\,n\,t}{T}), \, sin(\frac{2\pi\,n\,t}{T})$$

are also orthogonal, this time over the interval from 0 to T. If T = 1 and the signal x(t) happens to consist only of integer frequencies f_{n}, then we can say that the signal x(t) is the sum of orthogonal functions.

$$x(t)=\sum_{n=1}^{N} B_n \, cos(2\pi\,n\,t)+C_n \, sin(2\pi\,n\,t)$$

The simple waves in x(t) are orthogonal over the interval from 0 to 1, of course, only if x(t) consists of simple waves with integer frequencies.

This is an important result. If x(t) does in fact consist of integer frequencies, then its simple waves are orthogonal in the interval from 0 to 1, and we can compute the magnitudes of the coefficients B_{n} and C_{n}.

$$2 \int_0^1 x(t) \, cos(2\pi\,n\,t) \, dt=2 B_n \, \int_0^1 cos^2(2\pi\,n\,t) \, dt$$ $$=B_n \int_0^1 (1+cos(4\pi\,n\,t)) \, dt=B_n(1-sin(4\pi\,n)+sin(0))=B_n$$ $$2 \int_0^1 x(t) \, sin(2\pi\,n\,t) \, dt=C_n$$

## Frequency content of signals

Since, by definition

$$B_n=A_n \, cos(2\pi\,n\,\tau_n)$$ $$C_n=A_n \, sin(2\pi\,n\,\tau_n)$$

for some amplitude A_{n} and phase τ_{n}, then

$$|A_n|=\sqrt{B_n^2+C_N^2}$$ $$2\pi\,n\,\tau_n=atan2(\frac{C_n}{B_n})$$

We know that A_{n} is the amplitude of the n-th simple wave in the signal and 2π n τ_{n} is the phase of the n-th simple wave expressed as portions of the wave's cycle.

Thus, if a signal over a properly chosen interval consists of simple waves with integer frequencies, then we can compute the amplitude and phase of each simple frequency in the signal.

In the discrete time case, the above integrals can be approximated as the sum of the sampled function values at, say, N points, multiplied by the sampling interval (1 / N).

$$\frac{2}{N}\sum_{k=0}^{N-1}x(k) \, cos(\frac{2\pi\,n\,k}{N}) \approx B_n$$ $$\frac{2}{N}\sum_{k=0}^{N-1}x(k) \, sin(\frac{2\pi\,n\,k}{N}) \approx C_n$$

The amplitude and phase computations continue to apply.

The amplitude A_{n} and phase Φ_{n} of a simple wave with integer frequency n in a discrete signal x(k) defined over a period from 0 to 1 are

$$|A_n|=\sqrt{B_n^2+C_n^2}$$ $$\Phi_n=atan2(\frac{C_n}{B_n})$$

where, for some uniform samples k = 0, 1, …, N

$$B_n=\frac{2}{N} \sum_{k=0}^{N-1} x(k) \, cos(\frac{2\pi\,n\,k}{N})$$ $$C_n=\frac{2}{N} \sum_{k=0}^{N-1} x(k) \, sin(\frac{2\pi\,n\,k}{N})$$

One important question remains. We can perform the operations above for complex signals x(k) consisting of simple waves with integer frequencies. Not all complex signals, however, consist of simple waves of integer frequencies. Perhaps not all complex signals consist of simple sine and cosine waves to begin with. We do not know whether practical signals resemble sine and cosine waves in any way. As it turns out, whether or not practical signals are the sums of simple sine and cosine waves is not important.

In 1807 Joseph Fourier shows that any periodic function f(x) with a period of 2π that is integrable over [-π, π] can be approximated with a (potentially infinite) linear sum of sine and cosine waves as follows.

$$f(x) \approx \sum_{n=1}^{N} B_n \, cos(n\,x)+C_n \, sin(n\,x)$$

This sum is called the Fourier series of the function f(x). The Fourier series does not always converge and does not always approximate f(x) at every point.

The coefficients B_{n} and C_{n} are computed with the integrals

$$B_n=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \, cos(n\,x) \, dx$$ $$C_n=\frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \, sin(n\,x) \, dx$$

Shifting by π and replacing x with x = 2π t, we can obtain a similar result, namely that a continuous signal x(t) can be approximated with a sum of sine and cosine functions of 2π t over the interval from 0 to 1. We can also produce a similar result in the discrete case.

Thus, whether or not a practical signal is composed of sine and cosine waves, is not important. Within a given interval, we can approximate the signal with a sum of sine and cosine waves similar to the sum we have been using so far.

## Frequency content of an example complex signal

Take a complex signal that is the sum of the simple waves at 10 Hz, 25 Hz, and 50 Hz with amplitude of 1, 0.8 and 0.9 respectively. Suppose that we have the values of the signal sampled with some sampling frequency f_{s}, and nothing else. If we compute the amplitude of various frequencies in the frequency spectrum in this signal using the formulae above over the interval from zero to 1 (from sample 0 to the sampling frequency, thus setting N = f_{s} in these equations), we will obtain the graph in the figure below.

We know that simple waves at integer frequencies are orthogonal and so the result is expected. The graph is misleading, however, since we have done nothing about non-integer frequencies. Simple waves at non-integer frequencies are not orthogonal to the simple waves included in the signal for the chosen interval.

The blue line in the figure below shows the frequency content of the signal at non-integer frequencies around 25 Hz. As expected, the content of non-integer frequencies is not necessarily zero. These functions are not orthogonal to the simple waves of the signal in the selected interval. We can, however, make one important observation. Simple waves at non-integer frequencies are orthogonal to simple waves at integer frequencies for properly selected intervals. The simple waves at 5 Hz and 5.5 Hz, for example, are orthogonal in the interval from 0 to 4π, rather than from 0 to 2π as in our previous computations. Thus, we should be able to improve the computation of the frequency content, if we use longer intervals. The red line in the figure below shows the frequency content of the signal around 25 Hz, computed in the interval from zero to twice the sampling frequency. As expected, when doubling the interval, we will also get zero for the frequencies 22.5 Hz, 23.5 Hz, and so on.

## Root mean square (RMS) amplitude of a simple wave

The RMS amplitude of a simple wave x(k) = cos(2π f k / f_{s}) with frequency f over the interval from 0 to f_{s} is

$$A_{RMS}=\sqrt{\frac{1}{f_s} \sum_{k=0}^{f_s} x(k)^2}=\sqrt{\frac{1}{f_s} \sum_{k=0}^{f_s} x(k) \, cos(\frac{2\pi\,f\,k}{f_s})}$$ $$=\sqrt{\frac{B_n}{2}}=\sqrt{\frac{1}{2}} \approx 0.707107$$

This is so because a simple cosine wave has a Fourier series expansion that is itself and B_{n} = 1. The result is the same for a simple sine wave.

## Add new comment