You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spectrum.m
    path of file: ./repos/OPEN_FPE_IFT/Functions_v5-MATLAB
    
    the code of the file until where you have to start completion: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% This function calculates the energy spectral density (ESD) of the 
    
function calculates the energy spectral density (ESD) of the hot wire signal using 
% $\textbf{\textit{fft}}$ function of MATLAB. Also, the ESD with and without averaging 
% (moving average with equally spaced frequency interval in log-space) as a function of frequency 
% will be plotted.
%
% Arguments IN
% data = 1D array for which you would like to plot power spectram density(PSD)
% Fs= Sampling frequency in Hz
% increment_bin = The number of bins in which you would like to divide your data
% 
% Arguments OUT
% f = Frequency without smoothing
% spek = Energy spectral density(ESD) without smoothing
% x_achse_f_spektrum = Frequency with smoothing
% spek_smooth = Energy spectral density(ESD) with smoothing
% spek_power = Power spectral density(PSD) with smoothing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
function  [f, spek, x_achse_f_spektrum, spek_smooth,spek_power,I]=spectrum(data,Fs,increment_bin)
set(groot, 'defaultAxesTickLabelInterpreter','latex'); 
set(groot, 'defaulttextinterpreter','latex');   
set(groot, 'defaultLegend