<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 25 Aug 2015, at 02:34, Ben Hutchinson <<a href="mailto:benhut1@gmail.com">benhut1@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">I was looking at your webpage on the FFT here <a href="http://www.fieldtriptoolbox.org/tutorial/fourier">http://www.fieldtriptoolbox.org/tutorial/fourier</a> and noticed that the for an ordinary sinewave, like sin(x), the imaginary component of the FFT actually has a negative spike on the left side and a positive spike on the right side. Why is this? I thought that the left side of an FFT had the coefficient of the sinewave, and the right side of the FFT had the negative of that. So with a regular sinewave, (such as sin(x) which is actually the same as coef*sin(x) where coef=1) the left side of the imaginary part of the FFT is supposed to show that coefficient, meaning that it should have a spike of positive 1. But the FFT on this webpage instead shows a spike of -1 at that location. Why is that?<br></div>
</blockquote></div><br><div><br></div><div>Hi Ben</div><div><br></div><div>from Matlab "help fft"</div><div><div> </div><div><font face="Courier" size="1" color="#008f00"> For length N input vector x, the DFT is a length N vector X,</font></div><div><font face="Courier" size="1" color="#008f00"> with elements</font></div><div><font face="Courier" size="1" color="#008f00"> N</font></div><div><font face="Courier" size="1" color="#008f00"> X(k) = sum x(n)*exp(-j*2*pi*(k-1)*(n-1)/N), 1 <= k <= N.</font></div><div><font face="Courier" size="1" color="#008f00"> n=1</font></div><div><font face="Courier" size="1" color="#008f00"> The inverse DFT (computed by IFFT) is given by</font></div><div><font face="Courier" size="1" color="#008f00"> N</font></div><div><font face="Courier" size="1" color="#008f00"> x(n) = (1/N) sum X(k)*exp( j*2*pi*(k-1)*(n-1)/N), 1 <= n <= N.</font></div><div><font face="Courier" size="1" color="#008f00"> k=1</font></div></div><div><font face="Courier"><br></font></div><div>Note the “-j” in the first equation. </div><div><br></div><div>See page 158 in <a href="http://www.dspguide.com/CH8.PDF">http://www.dspguide.com/CH8.PDF</a> and specifically equation 8.3 on page 153, which explains it in more detail. I recommend the DSP guide as a general resource to learn more about digital signal processing.</div><div><br></div><div>best regards,</div><div>Robert</div><div><br></div><div><br></div><div>PS please address future questions to the email discussion list (CC) so that other people can benefit from it.</div></body></html>