Engineering How to compute the DFT of a cosine

  • Thread starter Thread starter ThinkingOutLoud
  • Start date Start date
  • Tags Tags
    Cosine Dft
AI Thread Summary
The discussion revolves around computing the Discrete Fourier Transform (DFT) of a cosine wave. The initial approach involves deriving x(k) to ensure its Inverse DFT (IDFT) results in cos(2*pi*n/N), leading to a simplified expression for x(n). A key point of confusion is the evaluation of k at -1, given that the series traditionally runs from k=0 to N-1. The periodicity of the exponential function allows for flexibility in choosing k values, suggesting alternatives that remain consistent with textbook conventions. Ultimately, the periodicity provides a valid justification for the calculations and adjustments in k selection.
ThinkingOutLoud
Messages
2
Reaction score
0
Homework Statement
Find the N-point Discrete Fourier Transform of x(n) = cos(2*pi*n/N)
Relevant Equations
DFT: x(k) = series from n=0 to N-1 of x(n) * exp^(-j*2*pi*n*k/N) for k=0 to N-1
IDFT: x(n) = series from k=0 to N-1 of x(k) *(1/N)* exp ^(+j*2*pi*n*k/N) for n = 0 to N-1
Hello,

This is a more general question than anything, but I am curious how to compute the DFT of a cosine wave.
Somebody tried to explain this to me as follows:

start by trying to find an x(k) who's IDFT equals cos(2*pi*n/N).
x(k) = (N/2) * (dirac-delat(k+1) _ dirac-delta(k-1)) only has values at k=1 and k=-1.

Thus the IDFT of x(k) is,
x(n) = series from k=0 to N-1 of (N/2) * (dirac-delat(k+1) _ dirac-delta(k-1))*(1/N)* exp ^(+j*2*pi*n*k/N) for n = 0 to N-1

this only has values at k= 1 and -1, so things simplify to
x(n) = (N/N) * (1/2) * (exp ^(+j*2*pi*n*1/N) + exp ^(+j*2*pi*n*(-1)/N) )

using eulers equation this becomes for cosine (.5*e^ja = cos(a) + i sin(a)

x(n) =cos(2*pi*n/N) which is the correct result (yay :)

However, what I don't understand is how we can justify evaluating k at -1 since our series technically goes from k=0 to N-1.
This makes me think that my solution is wrong. What are your thoughts?

Thanks,
:)
 
Physics news on Phys.org
ThinkingOutLoud said:
Relevant Equations:: DFT: x(k) = series from n=0 to N-1 of x(n) * exp^(-j*2*pi*n*k/N) for k=0 to N-1
IDFT: x(n) = series from k=0 to N-1 of x(k) *(1/N)* exp ^(+j*2*pi*n*k/N) for n = 0 to N-1
One can also let ##k## go from ##-N/2## to ##N/2##, due to the periodicity of ##e^{\pm j 2 \pi n k/N}##. It is the convention usually used for the fast Fourier transform (FFT).
 
  • Like
Likes ThinkingOutLoud
Hi,

Thank you for your reply. Ok, I guess that makes sense. In our book though, we technicaly haven't gotten to FFT so that probably why I haven't seen that yet.

Your response gave me an idea, given the periodicity of e±j2πnk/N , instead of choosing k=1 and k=-1, I could just as easily choose k=1 and k= N- some value?
the goal would be to still have by k boundary k=0 to N-1 so that I am consistent with our textbook.

Thanks.
 
ThinkingOutLoud said:
Your response gave me an idea, given the periodicity of e±j2πnk/N , instead of choosing k=1 and k=-1, I could just as easily choose k=1 and k= N- some value?
the goal would be to still have by k boundary k=0 to N-1 so that I am consistent with our textbook.
That should work.
 

Similar threads

Replies
8
Views
2K
Replies
2
Views
2K
Replies
6
Views
5K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
0
Views
150
Replies
1
Views
2K
Replies
2
Views
12K
Back
Top