Sequence's Discrete Fourier Transform method

161 Views Asked by At

So I have a sequence

{gk}^5, k=0 = {1, 0, 4, -1, 0, 0}

and I am to generate the Fourier sequence from that one. What I'm doing is simply using the formula:

Gk = gk * e^(-j2pi * n*k/T) where T = 6, n = 0...5 € Z

and to open up the previous formula because I'm sure it might look a bit confusing with the symbols I'm using/trying to use, here's how I generated G(0):

G(0) = g(0)*e^-j2pi*0*0/6) + 0 + g(2) * e^(-j2pi*0*2/6) - e^(-j2pi*0*3/6) + 0 + 0 
= 1 + 4 * e^0 - 1
= 4

and for G(1)

G(1) = g(0)*e^-j2pi*0*1/6) + 0 + g(2) * e^(-j2pi*1*2/6) - e^(-j2pi*1*3/6) + 0 + 0 
= 1 + 4(cos(2pi/3)-j*sin(2pi/3)) -(cos(pi)-j*sin(pi))
= 1 - 2 + 1 + 2*sqrt(2)j
= 2*sqrt(2)j

And this is the logic I'm using to calculate the DFT, but for some reason just about every online calculator regarding DFT is giving a different answer when compared to mine and other online DFT calculators, so I'm a little bit lost here.

Is there some glaring problem with how I'm trying to calculate the DFT or is this how it's supposed to go?

1

There are 1 best solutions below

3
On BEST ANSWER

If we use Gnu Octave (and probably also if we use Matlab), the commands:

exp(-2*pi*1i*(0:5)'*(0:5)/6)*[1,0,4,-1,0,0]'

conforms with

fft([1,0,4,-1,0,0]')

which is the built in Fast-Fourier routine. Both give:

 4.00000 + 0.00000i
 0.00000 - 3.46410i
-2.00000 + 3.46410i
 6.00000 + 0.00000i
-2.00000 - 3.46410i
 0.00000 + 3.46410i

In excess of this it is important to know that there exist different definitions, for example can the normalization be different (constant multiplication).

You can take a look at the matrix

exp(-2*pi*1i*(0:5)'*(0:5)/6)

To see the coefficients in the sums too see if you got the coefficients right in the calculations.

Disrete Fourier Transform - Wikipedia ( compare Unitaire transformatie vs first expressions, there is a difference of a factor $\frac{1}{\sqrt{N}}$, where $N$ number of samples. )

Also Wolfram Alpha's answer seems to be using backwards phase (plus instead of minus in exponent) in excess to the normalization factor $1/\sqrt{6}$.