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, "r");
xlabel("Time (s)");
ylabel("Function-1 (t)");
title("Sinc(10.t) Function in the Time Domain");
subplot(2, 1, 2);
plot(f, function_4, "r");
xlabel("Frequency (Hz)");
ylabel("|Function-4 (f)|");
title("Amplitude Spectrum of Sinc(10.t) Function in the Frequency Domain");
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.