How to compute the DFT of a cosine

  • Context: Engineering 
  • Thread starter Thread starter ThinkingOutLoud
  • Start date Start date
  • Tags Tags
    Cosine Dft
Click For Summary

Discussion Overview

The discussion revolves around the computation of the Discrete Fourier Transform (DFT) of a cosine wave. Participants explore the mathematical formulation and implications of using specific values for the index in the DFT and Inverse DFT (IDFT) equations, as well as the periodicity of the exponential terms involved.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant describes an approach to compute the DFT of a cosine wave by proposing a specific form for x(k) that leads to the desired IDFT result.
  • Concerns are raised about the justification for evaluating k at -1, given that the series for k is defined from 0 to N-1.
  • Another participant notes that k can also be considered from -N/2 to N/2 due to the periodicity of the exponential function, which is a convention in FFT.
  • A suggestion is made to choose k values that remain within the bounds of 0 to N-1 while still leveraging the periodicity of the exponential terms.

Areas of Agreement / Disagreement

Participants express uncertainty about the validity of using k = -1 in the context of the DFT's defined range. There is no consensus on the best approach to handle the periodicity and the choice of k values.

Contextual Notes

Participants acknowledge that their understanding may be limited by the scope of their current studies, particularly regarding the FFT and its conventions.

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   Reactions: 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 7 ·
Replies
7
Views
801
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K