Fourier Series-Fourier Transform
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:
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:
From eq 1.2, we can eventually derive a formula for ππ as following:
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:
By integrating both sides of eq 1.1 over one period, we can also easily show that:
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 :
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:
With the same procedure
The same integrals can be written also as following according to eq 3.1
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.
Since cosine is even and sine is an odd function, the following equations are true, which we will need as we move further.
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:
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.
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:
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:
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:
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 π
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.