0
$\begingroup$

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;

enter image description here

enter image description here

$\endgroup$

1 Answer 1

3
$\begingroup$

Why are you performing division? That's just an incorrect assumption. Since the DFT is a linear operation, if you add the sinusoid before the DFT, then if you wanted to cancel it out in the frequency domain, you would subtract the DFT of the sinusoid. Still not a very practical approach, but it would work for your example. There are very few cases where you would want to divide spectra; one problem is that if the denominator spectra has any nulls in it, your result ends up as infinite, which is unlikely to be desirable.

$\endgroup$
1
  • $\begingroup$ You are absolutely correct. I don't know what I was thinking! I guess I had a lapse of reason and mixed up addition and convolution. $\endgroup$ Commented Sep 23, 2013 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.