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$
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$
  • $\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$ – user1641496 Sep 23 '13 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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