Message Boards Message Boards

Using Fourier function to determine discreet fourier transform of a signal

Hi,

I have been using Fourier function in Mathematica to determine the DFT of a signal, however I found that the result are inaccurate than the expected result. Suppose that I want to determine the coefficient of sin(x) at fundamental frequency, which should gives -0.5i.

My code is :

Part[Fourier[Table[Sin[2*Pi*100*t/100000], {t, 100000}], 
  FourierParameters -> {1, -1}], 101]/100000

However, the answer Mathematica gave is 0.00314157 - 0.49999i. The result are getting more closer to -0.5i if I increase the number of samples. Is there any other way to use Fourier function to get accurate result?

I noticed that there are several other function in Mathematica that can do the trick such as FourierCoefficient and FourierSeries. However this function becomes stuck with my complicated trigonometric terms. In Matlab I simply used FFT function and it works. Any solutions?

Thanks, Syed

What you are getting is correct for the given input (a pure sinusoid that begins slightly larger than zero). To obtain the desired result, shift by one to the left so that the first value is zero, not Sin[2*Pi*100/100000].

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract