Discrete Fourier Transform of Even Function

In summary, Reuben is confused about the DFT of the data and is unsure what is wrong. The Fourier coefficients are real, but when he takes the FFT of the data in Matlab, he gets complex numbers. He suspects that something is wrong with how he is using Matlab, but he is not sure what it is.
  • #1
rmp251
8
0
I'm confused about the DFT of the data, fn = cos(3[itex]\pi[/itex]n/N) for n=0,1,...,N. It is definitely an even function, and I read that the Fourier coefficients of an even function is real. But when I take the FFT of this in Matlab I get complex numbers, not real numbers. What am I missing?

Thanks !
Reuben
 
Physics news on Phys.org
  • #2
The Fourier coefficients are real. I can only guess that there may be something wrong in the way you are using Matlab or Matlab may have an error.
 
  • #3
The code is pretty simple:

N=16;
n = [0:N-1];
f = cos(3*pi*n/N);
F = fft(f,N);

The resulting F is:
1.0000
1.0000 + 4.1412i
1.0000 - 5.6858i
1.0000 - 2.0586i
1.0000 - 1.2027i
1.0000 - 0.7609i
1.0000 - 0.4596i
1.0000 - 0.2180i
1.0000
1.0000 + 0.2180i
1.0000 + 0.4596i
1.0000 + 0.7609i
1.0000 + 1.2027i
1.0000 + 2.0586i
1.0000 + 5.6858i
1.0000 - 4.1412i
 
  • #4
This function is not even--remember that the DFT makes the hidden assumption that your signal is periodic outside of the specified ordinates, so f(-16:-1) = f(0:15). Your function is mostly (but not exactly) odd, so you mostly have an imaginary transform, but it is complex. You have a discontinuity between n=-1 and n=0 (and also n=16, 17), resulting in a smeared spectrum.
 
  • #5
I understand... except the part where you say the function is not exactly odd. Based on what you're saying, if we extend the signal beyond n=0..N-1 to make it periodic, then isn't it exactly odd (regardless of any discontiniuity)?

Thanks all for the responses!
 
  • #6
Not quite. Try plotting it in Matlab. You have f(0)=1, so to be exactly odd you'd need f(-1)=f(15) =-1. It's not.

EDIT: Ah, that's where the real 1's come from.

Imagine that you take your sequence as is except you set f(0)=0--now it's exactly odd, because f(1)=-f(-1)=-f(15). So the transform of this sequence is purely imaginary.
The sequence {f(0)=1, f(1:15)=0} is even so its spectrum is pure real. In fact, this sequence is an impulse, so its spectrum is all ones.
Add them together to form the total sequence you wrote. Since DFT is a linear operation, the total spectrum is the sum of the individual spectra, one of which is imaginary and the other of which is all real ones.
 
Last edited:
  • #7
Why do we need f(-1)=f(15) = -1 ?

We have f(-1)=f(15) by periodic extension. And f(-1)= -f(1) = -0.8315.

We're talking about odd meaning antisymmetric about the f axis (n=0), correct?
 
  • #8
Right. f(15)=f(-1)=-0.83 and f(1)=+0.83, etc., so the sequence is exactly odd if f(0)=0.
 
  • #9
I was missing the f(0)=0 requirement. Makes sense now.

Thanks a lot for the insight!
 

What is the definition of Discrete Fourier Transform (DFT)?

The Discrete Fourier Transform is a mathematical algorithm used to convert a signal from its original form in the time domain to its representation in the frequency domain. It is commonly used in signal processing and data analysis to analyze the frequency components of a signal.

What is an Even Function?

An even function is a mathematical function where the input value and the function output are symmetric across the y-axis. In other words, if you were to fold the graph of an even function in half, the two halves would match up perfectly. Examples of even functions include cosine and exponential functions.

How does the Discrete Fourier Transform of an Even Function differ from a general DFT?

The Discrete Fourier Transform of an Even Function has a special property where the frequency components are mirrored across the vertical axis. This means that for an even function, the DFT will only contain the positive frequencies, while the negative frequencies will be an exact copy of the positive ones. This is not the case for a general DFT, where both positive and negative frequencies are present.

What is the formula for computing the DFT of an Even Function?

The formula for computing the DFT of an even function is similar to that of a general DFT, but with some simplifications. Since the negative frequencies are just a mirror of the positive ones, they can be omitted, resulting in a more efficient computation. The formula is as follows:

DFT(x[n]) = 2 * DFT(even part of x[n])

What are some practical applications of the Discrete Fourier Transform of Even Functions?

The DFT of even functions has various applications in fields such as signal processing, image processing, and data analysis. It can be used to analyze the frequency components of a signal, filter out specific frequencies, and reconstruct a signal from its frequency components. It is also useful in image compression and noise reduction techniques. Additionally, the DFT of even functions is used in the Fast Fourier Transform (FFT) algorithm, which is widely used for efficient computation of the DFT.

Similar threads

Replies
3
Views
994
  • Calculus
Replies
3
Views
1K
Replies
11
Views
849
  • Calculus
Replies
11
Views
2K
  • Differential Equations
Replies
4
Views
2K
  • Linear and Abstract Algebra
Replies
4
Views
883
  • Calculus
Replies
8
Views
4K
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
404
Back
Top