How to do a fast Fourier transform (fft) in MATLAB from an xlsx data file given in Microsoft Excel
Channel: Mathias Magdowski
Date: 2022-12-28

Important:
In the video, I forgot to set the first time step to zero, which results in a wrong scaling of the frequency axis (highest frequency is 3 1/a). If you run
t_months=t_months-t_months(1);
after setting the variable t_months, then you get the correct result (where the highest frequency is 6 1/a).

Description:
In this short video, I explain how to import a given xlsx file with raw data from Microsoft Excel into MATLAB, how to extract the time steps and numerical values of the time function from the given table sheet, and how to plot the time domain data. After checking the validity of the data (equidistant time steps, no slope in the data), I show how to calculate the frequency spectrum and the corresponding frequency values using the given 'fourier' function. Finally, I demonstrate how to plot the amplitude spectrum with a linear and logarithmic axes scaling.

MATLAB source code of the example:
https://cloud.ovgu.de/s/YSCPpasgypaoG23

Chapter marks:
0:00 Introduction and looking at the Excel sheet
1:25 Import with xlsread
4:06 Plot the time domain data
6:58 Fourier analysis
8:46 Plot the ampitude spectrum
11:51 Repeat the fft analysis within a loop
14:41 Plotting with a logarithmic amplitude scale
15:59 Summary and discussion