Inconsistency Between Analysis and Simulation Results of Fourier Transform of a Sinc Function First of all, hello.
This question is about a problem that I’ve faced during an attempt to obtain both time and frequency responses of a sinc function in MATLAB. The problem is an inconsistency between my calculations that I’ve done on the paper and simulation results that I’ve observed in MATLAB.
I’ve picked up $sinc(10 \cdot t)$ function and at first, I’ve taken its Fourier transform on paper. Afterwards, in order to have an experience in coding, I implemented this operation into MATLAB and plotted the functions both in the time and frequency domains.
However, in the amplitude spectrum in the frequency domain, the amplitude of the resultant rectangular pulse didn’t match with my results on the paper. According to my analysis results, the amplitude of the rectangular pulse is 0.1 but in MATLAB, I’ve got 10 instead of it.
My MATLAB code for simulation is given below:
t = -10: 0.01: 10; 
Ts = 0.01;  % Sampling period in seconds
fs = 100;  % Sampling frequency in Hertz
function_1 = sinc(10 * t);  
number_of_samples_1 = length(function_1);
number_of_samples_2 = power(2, nextpow2(number_of_samples_1));
f = linspace(-fs / 2, fs / 2, number_of_samples_2);   
function_2 = fft(function_1, number_of_samples_2);
function_3 = fftshift(function_2);
function_4 = abs(function_3);
subplot(2, 1, 1);
plot(t, function_1, &quot;r&quot;);
xlabel(&quot;Time (s)&quot;);
ylabel(&quot;Function-1 (t)&quot;);
title(&quot;Sinc(10.t) Function in the Time Domain&quot;);
subplot(2, 1, 2);
plot(f, function_4, &quot;r&quot;);
xlabel(&quot;Frequency (Hz)&quot;);
ylabel(&quot;|Function-4 (f)|&quot;);
title(&quot;Amplitude Spectrum of Sinc(10.t) Function in the Frequency Domain&quot;);

My question is this: Why has this result occurred in contrast to my expectations and analysis?
I will be happy if you give feedback to my problem and question.
Thank you.
I have recently answered a related question.
What happens is that MATLAB fft is calculating a sum in the sampled points, the integral would be approximated with a (Riemann) sum.
$$ \int_{0}^{T} f(x)dx \approx \sum_{k=0}^{N-1} x(k \Delta t) \Delta t$$
The $\Delta t=0.01$ factor matches the two results.