t = linspace(-5,5,1000);
x = sin(pi*t)./(pi*t);
plot(t,x);
hold on;

w = linspace(-4*pi,4*pi);
dw = w(2)-w(1);

X = 2*sin(w)./w.*(1-cos(2*w));
y = zeros(1,length(t));

for k = 1:length(w);
    y = y + X(k)*exp(j*w(k)*t)*dw;
end

plot(t,y/(2*pi),'r');