The first situation:
%% Analytical calculation syms t f h = @(f) int(sinc(t)*exp(-1i*2*pi*f*t),t,-10,10); subplot(2,1,1); fplot(real(h(f)),[-3 3]); grid; y