clear all; close all;
source = 'hw8prob2data';
d = load(source);
d = d(:,1)+1j*d(:,2);

x = 1/2*linspace(-1,1,256);
y = zeros(size(x));

for i = 1:length(d)
    yi = d(i)*exp(1j*2*pi*i*x);
    y = real(yi)+y;
end

plot(x,abs(y).^2);
ylabel('Intensity (a.u.)');
title('Problem 2');
grid on;