# spectral division

Sorry if this is elementary. If I add a small sinusoidal signal to my data and then take FFT of both my original and the modified one and then inverse FFT the division of the two, I should then be left with the sinusoid. But when I do the above, I get a shift in my output, as if the phase is lost. What am I doing wrong ? thanks.

FS = 500;

MODIFIED=fft(inp(512:1023)+sinus); %inp = data + tapered sinsus

INP=fft(inp);

out=ifft(MODIFIED./(INP+eps))/FS;