# Fourier Transform Theory

|In this post we are going to see the theory behind the Fourier Transform in an understandable way so you can be ready to practice with **our next post, which will be a Matlab tutorial, including the code and solutions**.

### Intro

The Fourier Transform (

**FT**) is a mathematical tool that allows us studying a time domain signal in its equivalent in the frequency domain.In the past, the FT was a tedious process which implied a continuous distribution of data and it was used just when there were no other alternative. Nowadays, thanks to the computing developments and the Discrete Fourier Transform (DFT) and the Fast Fourier Transform (FFT) (the latter is the name for the main computational algorithm used to evaluate the DFT), it is more convenient to perform the frequency analysis in the discrete time domain.

Sampling is the process of taking periodic amplitude samples of an analog signal,

**being the interval between samples a constant**. The sampling rate is named the**sampling frequency**and it determines the number of samples that are taking in a time interval.The sampling process requires to meet some conditions (

**Nyquist Theorem**), aiming to avoid effects such as aliasing and leakage.In our

**next post we will develop a deep study of the FT in the frequency domain, as well as, the sampling process**and the different implications; all of this, using**Matlab**. Now we are going to do a theoretical study, where we will see the properties of the FT and the equations that define them. Also, we will introduce some**useful Matlab functions**to develop this study.### Theoretical Approach

The Fourier Transform (

**FT**) is a mathematical tool that allows us studying a time domain signal in its equivalent in the frequency domain (we said this at the beginning of the post, but we repeat it here because it is important to understand it).Depending on the type of function that we want to transform, we can use different methods:

- Continuous and non-periodic: Fourier Transform
- Continuous and periodic: Fourier Series
- Discrete and non-periodic: Discrete Fourier Transform in the Time Domain
- Discrete and periodic: Discrete Fourier Transform

In this post,

**we will focus on the in the****Discrete Fourier Transform (DFT)**. Therefore, you need to think in a periodic digital signal, with infinite periods.When applying the DFT in a time-domain signal, we need to represent the transformed signal in the frequency domain:

The x-axis can be expressed in 4 different ways:

- Fractions of the sampling frequency.
- Sampling number.
- Frequency in radians.
- Absolute frequency.

Figure 1. Example of time-frequency transformations

If we want to come back to the time domain, we will use the Inverse Discrete Time Fourier (

**IDFT**).As mentioned, the FT can be applied to continuous and discrete signals.

If we apply it to continuous signals, we will get just a replica of the signal’s spectrum:

**If it is periodic**, there will be replicas in the fundamental frequency and its multiples.**If it is not periodic**, its spectrum will be continuous.

In case of discrete signals, the DFT is obtained by taking samples of a continuous signal:

where fs is the sampling frequency. In addition, it will admin an FT, X(Ω), where

After sampling, there will appear replicas of the spectrum: the original (low-pass) and in the sampling frequency and its multiples.

## NEGATIVE EFFECTS

### ALIASING

When reconstructing a signal from its samples, it is necessary to consider the

**Nyquist frequency**. This concept will allow us to find the sampling frequency that will give us a perfect reconstruction of the signal. If we use a very low frequency (lower than the Nyquist frequency,**fs<2W**), the reconstruction won’t be perfect:**this effect is named aliasing or overlapping**. Aliasing happens when some periodic signal replicas in its spectrum are overlapped as in the following image:Figure 2. Aliasing effect

Have a look to this tutorial to better understand how the sampling frequency affects the signal reconstruction.

In the frequency domain, we will see how part of the signal will overlap with the next part. These overlapped values will be added together and the spectrum shape will be wrongly modified. Therefore,

**we need to sample with a frequency equal, at least, two times the signal bandwidth to avoid this effect**.Figure 3. Aliasing signal reconstruction

### LEAKAGE EFFECT

This effect is based on the frequency accuracy . If the signal frequency, fc is not a multiple of fs/N, the FFT won’t evaluate what happens in fc; instead, it will take the values of what is happening a bit at the left and at the right of fc and it will give an interpretation that is called the leakage effect.

In other words, this means that the spectral density has been leaked to original frequency’s nearest values. In addition, we will see smaller replicas in the signal harmonics.

In order to reduce this effect there are 3 approaches:

- Increase the number of samples adding zero values (this is called zero padding).
- Transform a given proportion of values at the beginning and at the end of the series with a sinusoidal signal.
- Smooth the values by applying data windowing.

### LIST OF FUNCTIONS IN MATLAB

The main Matlab functions that you need to know (as we will see in our

**next FT Tutorial**) are: