x = [-0.5:0.01:0.5];
s = [];
for f = -4:0.1:4,
    s = [s, 0.01*sum(exp(-2j*pi*f*x)')];
end

plot([-4:0.1:4], s, 'b')
grid