x=[-5.8284, 4.1761, 3.8284, -6.1716, 7.8284, 9.8284, -1.8284, -3.8284];
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))

spec2=spec.*[0 0 1 0 0 0 1 0];

x2=8*ifft(spec2);

figure(3)
subplot(2,1,1)
stem(real(x2))
subplot(2,1,2)
stem(imag(x2))