Fourier Series-Fourier Transform

Kamil Budagov
11 min readOct 23, 2022

--

Introduction

In this paper, I will explain how the Fourier transform is obtained from the Fourier series. First, it will be explained how a periodic signal can be represented by Fourier coefficients. The orthogonality principle will be considered, after which you will learn how to derive Fourier coefficients. Finally, the idea of discrete Fourier coefficients will be extended to a continuous frequency spectrum as the period becomes infinitely large. In the end, you will be able to extract individual harmonics from any periodic signal and analyze the frequency spectrum of non-periodic signals.

Fourier Series

In the 19th century, French mathematician Joseph Fourier discovered that any periodic signal is comprised of different sine waves as follows:

Equation 1.1

Where πœ”0 is the angular frequency of periodic signal f(t) ( πœ”0 = 2πœ‹/𝑇0 ). If we can calculate coefficients π‘Žπ‘› and 𝑏𝑛 , then by adding different terms we can build our signal f(t). In order to obtain π‘Ž_𝑛, let us first multiply both sides of eq 1.1 by cos(πœ”0π‘šπ‘‘) (where m is a positive integer) and integrate both sides over one period:

The first term on the right will always be zero, which can be justified just by solving the definite integral as shown below:

( sin(πœ‹π‘š) is always zero since m is a positive integer ). According to orthogonality (which will be explained in the next few steps), the following equations are true:

So the only term on the right side of eq 1.1 will exist when n = m. Therefore, eq 1.1 can be rewritten as follows:

Equation 1.2

From eq 1.2, we can eventually derive a formula for π‘Žπ‘› as following:

Equation 2.1

Applying the same procedure (by multiplying both sides of eq 1.1 by sin(πœ”0π‘šπ‘‘) and integrating over one period) we can derive formula for 𝑏𝑛 as:

Equation 2.2

By integrating both sides of eq 1.1 over one period, we can also easily show that:

Equation 2.3

Orthogonality

Now it is time to understand orthogonality, which states that the following integral is equal to zero provided that u_n(t) and v_m(t) are orthogonal.

Our target is to prove that sine and cosine waves (two cosine waves too) are orthogonal. Therefore, let u_n(t) indicate sin (𝑛𝑑) or cos(nt) and v_m(t) indicate sin (m𝑑) or cos(mt). Let us start by finding the second derivatives of u_n(t) and v_m(t) with respect to t :

Equation 3.1

Now let us assume that we want to evaluate the following integral by applying a technique called integration by parts:

You can easily prove that the first term on the right side of the equation is equal to zero by calculating it for all combinations of u_n(t) and v_m(t). Therefore, we can rewrite the above formula as:

Equation 3.2

With the same procedure

Equation 3.3

The same integrals can be written also as following according to eq 3.1

Equation 3.4

The right sides of equation 3.2 and 3.3 are equal to each other, however those of equation 3.4 cannot be as long as , π‘š β‰  𝑛 , therefore we can deduce that

is actually equal to zero, if π‘š β‰  𝑛.

Complex Fourier Series

Sometimes it is easier to work with complex Fourier series, which convey exactly the same information as the previous one. On the other hand, in the case of complex Fourier series, we deal with only one complex coefficient 𝑐_𝑛, which contain π‘Ž_𝑛 and 𝑏_𝑛 coefficients in its real and imaginary parts respectively. In order to obtain a complex Fourier series representation from a conventional one, we will need the formulas for coefficients π‘Ž_𝑛 , 𝑏_𝑛 and π‘Ž_0 which is summarized in the following figure.

Figure 1

Since cosine is even and sine is an odd function, the following equations are true, which we will need as we move further.

Equation 4.1

Now let us recall the conventional Fourier series representation introduced previously.

According to Euler’s great formula, cosine and sine waves can be represented by complex exponentials as follows:

Putting these equations into conventional representation will give us:

By arranging terms, we can rewrite the above formula as:

We can show the third term of f(t) like the following just by reversing signs at any instant of n:

Taking eq 4.1 into account, we can rewrite f(t) as:

Since π‘Ž_0 can be shown as below, we will finally get following representation for Fourier series:

Eventually, we will end up with the following formula, which is also known as the complex Fourier series:

Equation 4.2

If we know the coefficient 𝑐_𝑛 for n=0,1,2,3.. then we can also obtain π‘Ž_𝑛 and 𝑏_𝑛 coefficients which are hidden in the real and imaginary parts of the complex number 𝑐_𝑛, that is why it is sometimes easy to work with 𝑐_𝑛 rather that calculating π‘Ž_𝑛 and 𝑏_𝑛 separately. The final formula for 𝑐_𝑛 can be derived by substituting respective formulas in figure 1 into the first equation in the eq 4.2.

Equation 4.3

Now let us consider one example regarding the calculation of Fourier coefficients and approximating f(t) by adding several terms.

Example 1

Consider the periodic rectangular wave (pulse width = 2 and 𝑇0 = 2πœ‹) given in the following picture:

We should find out which harmonics exist in this signal.

Solution:

Consequently:

Substituting these results into eq 1.1 will give us:

By implementing this formula in MATLAB for n up to 20, we can obtain the following approximation for f(t). It should be noted that approximation becomes better as we add more terms.

As you can notice, f(t) contains only cosine waves since it is an even function. When the period is 2πœ‹, πœ”0 is equal to one. We can also represent f(t) in the frequency domain by plotting 𝑐_𝑛 versus πœ” as following:

f (t) contains only integer multiples of πœ”0 as it appears from the plot.

Keeping pulse width constant, let us now increase the period (T0 = 4πœ‹, 8πœ‹ and 128πœ‹) and plot 𝑐_𝑛 versus πœ” for each case. Results are given in Figure 2:

Image by author. Figure 2

What can be deduced from the comparison of the four plots above is that all plots have the same envelope; however, the magnitude of each frequency goes down as the period becomes larger. Furthermore, as the period becomes larger f(t) contains more frequencies per range (in other words becomes more continuous) and when the period is infinite, the frequency axis becomes continuous. We can think of a non-periodic pulse or any other time-limited signal as a periodic signal assuming the period is infinite. The interesting point here is that even non-periodic signals are comprised of different frequencies (but with infinitesimal magnitudes since the magnitude of each frequency goes down as the period becomes larger). In the next step, we will explain how the Fourier transform formula is derived from the Fourier series for non-periodic signals.

Fourier Transform

So far, we derived:

Equation 4.2
Equation 4.3

Substituting eq 4.3 into eq 4.2 gives us:

Now let us consider the case for which the period is infinitely large:

Consequently πœ”0 will be infinitesimal since Ο‰0 = 2Ο€ /T0 and can be indicated by dΟ‰:

As πœ”0 gets smaller, the difference between two consecutive frequencies becomes very small. Given that n discretely runs from βˆ’βˆž to +∞ and πœ”0 is infinitesimal, πœ”0*n becomes analog and can be represented by a continuous variable Ο‰. (that can obtain all values on Ο‰ the axis)

Considering the above modifications, we can rewrite f(t) as follows:

After obtaining the above formula, we can finally denote the Fourier transform of f(t) by F (πœ”) which is calculated according to the formula below:

While the inverse Fourier transform is shown as:

Let us consider one example and explain the important outcomes.

Example 2

The following pulse is nonzero only from t = -1 to 𝑑 = 1 . Let us calculate its FT and extract useful information from the result.

According to the formula, the FT of the above pulse will be:

Graphically:

Figure 3

What useful information can be extracted from the above frequency spectrum is that pulse f(t) contains all frequencies except integer multiples of πœ‹. Unlike in the discrete frequency spectrum, the value of F(Ο‰) for any Ο‰ does not represent the exact magnitude of each frequency, but rather its relative contribution to f(t). As you can see, the lower frequencies dominate the frequency spectrum, and the effect of high frequencies is less. By comparing Figure 3 to Figure 2, we can notice the same envelope for both discrete and continuous frequency spectrums. This once again proves that the FT is actually a Fourier series representation for time-limited signals (signals with an infinite period).

Example 3

Now let us consider the following pulse:

The Fourier transform will be:

As you can see Fourier transform is complex and therefore has associated magnitude and phase which depend on πœ”

Figure 4

By comparing Figure 4 to Figure 3, we can see that both have the same magnitude frequency spectrum, which implies that both pulses are comprised of the same frequencies and with the same strengths.

However, here we have a phase which is nonzero and linearly dependent on πœ” as follows:

In example 2, our pulse is comprised of cosine waves with zero phases, which means all of the cosine waves are centered around 𝑑 = 0. We should know that all cosines must be shifted right in order to obtain the pulse of example 3 from that of example 2, and the phase ∠F(Ο‰) shows how much each harmonic must be shifted.

In example 2, at t = 0, each cosine gets a value equal to one. Intuitively, in example 3, at 𝑑 = 1, each cosine should get the same value. In other words, if one of the harmonics contributing to f(t) in example 2 is π‘π‘œπ‘ (3.2𝑑) of some magnitude, then in example 3 this harmonic is replaced by π‘π‘œπ‘ (3.2𝑑 βˆ’ 3.2) of the same magnitude, because ∠F(Ο‰) = βˆ’Ο‰.

Application

Here, I would like to consider one application of FT in signal filtering. Assume that we have the following LTI system:

Where the output is calculated by convolution of x with h as follows:

Assuming we have a frequency spectrum for x(t) and h(t), let us calculate the FT of the above output:

The arrangement and manipulation of the terms as below will give us the following result:

The final result will be:

This equation is very important in order to understand how the filter works. If an impulse response is a sinc function, then its Fourier transform will be a rectangle. Assuming that the Fourier transform of π‘₯(𝑑) and β„Ž(𝑑) are known, the frequency spectrum 𝑦(𝑑) can be obtained easily just by multiplying 𝑋(π‘–πœ”) with 𝐻(π‘–πœ”). The filteration process is summarized in the below diagram:

πœ”π‘ here is cutoff frequency which is maximum frequency that filter let pass, frequencies more than πœ”π‘ are removed, while πœ”N is the highest frequency component existing in the π‘₯(𝑑).

Conclusion

I hope you understood how a periodic signal is represented by adding different frequencies and why the frequency spectrum is continuous for time-limited signals. FT is widely applied in signal processing, image processing, solving differential equations, and even in quantum mechanics. This powerful transformation actually says that any practical signal (almost all practical signals are time-limited) can be represented by its frequency spectrum. And in most cases, working with frequency spectrum is significantly more efficient.

--

--