x=[1-3*sqrt(2), 2, 1-sqrt(2),6,1+3*sqrt(2),-6, 1+sqrt(2), 2];
figure(1)
stem(x);

spec=1/8*fft(x);

figure(2)
subplot(2,1,1)
stem(real(spec))
subplot(2,1,2)
stem(imag(spec))

figure(3)
stem(abs(spec).^2)