Investigating an Unexpected Result with DFT: Examining Example 1

In summary, the spectrum repeats (aliases) about the sample rate in Example 1. The DFT should only return the frequency of the signal, but it did not work for the guy because he was not using the 1/N part.
  • #1
btb4198
572
10
ok this is the best example i could find of DFT
http://faculty.ksu.edu.sa/ghulam/Documents/CEN352/DSP_CEN352_ch4_DFT.pdf

example 1)
this is what I am trying to do...
however it did not work for the guy...

f[1] should be the only one with an value
but it was a j0.5 and he got that for ever N-3..
why?

DFT should only return the frequency of the signal right?
so it should only return 1...
so why did it not work?
is he doing someone wrong in Example one ?
 
Engineering news on Phys.org
  • #2
The spectrum repeats (aliases) about the sample rate. The basic DFT is from -2 to +2 and has a value in the +1 and -1 bins. If you only look at the -2,-1,0,+1,+2 bins you see what you'd expect.

His first example was pretty clean.
 
  • #3
ok I get what you are saying however I do not understand the " You wee what you'd expect" .

Wiki " In mathematics, the discrete Fourier transform (DFT) converts a finite list of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids, ordered by their frequencies, that has those same sample values. It can be said to convert the sampled function from its original domain (often time or position along a line) to the frequency domain."

so I would expect to see f[1] having a coefficients with a right number and the other to be 0.

ok I am very new to this. so what am I missing ?

also he has f[r] = 1/N Ʃ x(k) e^((-j2πfK)/n) for example 1 but for example 2 he does not have the 1/N.. when do you need the 1/N part?
 
  • #4
The 1/N part is always confusing. You sometimes need to normalize. I can't easily explain it. Remember how you got 16 on a 16 sample sine wave? The 1/N would have made it 1. Some derivations use 1/sqrtN on both DFT and IDFT, some use 1/N on DFT, maybe some do 1/N on IDFT. A DSP expert could explain it better. It is just a scaling factor.

This example has both positive and negative frequency, so there is energy in both the +1 and -1 bins. (it reflects around 0)

I really recommend watching some lectures on DSP that address the fundamentals of discrete signals.
 
  • #5
what happened if you add two signals with the same frequency together ?
 
  • #6
If you add two signals with same frequency f1 ,Y[t]=A1*sin(2*pi*f1*t)+A2*sin(2*pi*f1*t) then when you compute the DFT, you get the max of the spectrum as the sum of theirs amplitudes A1+A2 at frequency f1 such f1 in [0, Fs] .
 
  • #7
KHMOU YOUSSEF said:
If you add two signals with same frequency f1 ,Y[t]=A1*sin(2*pi*f1*t)+A2*sin(2*pi*f1*t) then when you compute the DFT, you get the max of the spectrum as the sum of theirs amplitudes A1+A2 at frequency f1 such f1 in [0, Fs] .

could you do the math and post it ?
because I am really starting to think that the DFT does not work..
I have see many examples online and none return the right frequency
 
  • #8
what software are you using, ? here is an example using Matrix Laboratory :

Fs=80;
f=35;
t=(0:1/Fs:2-1/Fs);
a1=2;
a2=5;
y=a1*real(exp(j*2*pi*f*t))+a2*real(exp(j*2*pi*f*t));
n=length(y);
fy=fft(y,n)*2/n;
freq=(0:n-1)*Fs/n;
plot(freq(1:end/2), abs(fy(1:end/2)))
 
  • #9
I am write my on code in c# and I am going it by hand

so this is from math lab
x[n] = {1 –1 1 –1}

>> x = [1 -1 1 -1];
>> X = fft(x)
*
X =
*
0 0 4 0

*
4 0 0 0

but that is Wrong!
Math lab is wrong!

I did it by hand I got this
i used
3
F[r] = Ʃ F[K]ε ^(-j 2πKr)/N
K=0
F[0] = 1 -1 +1 -1 = 0
F[1] = 1 + j +1 - J = 2
F[2] = 1 -1 -1 -1 = -2
f[3] = 1 +j +1 - j = 2
I do not understand
what is wrong with math lab ?

what it math lab doing ?
 
  • #10
I do not have Matrix Laboratory
can you do it by hand and post it that way?
 

1. What is DFT and how is it used in scientific research?

DFT, or Density Functional Theory, is a computational method used in scientific research to study the electronic structure of molecules and materials. It is based on the principles of quantum mechanics and allows for the prediction of various properties, such as energy levels and molecular geometries, without the need for expensive and time-consuming experiments.

2. Can DFT accurately predict experimental results?

While DFT is a powerful tool for predicting electronic properties, it is not a replacement for experiments. Factors such as the choice of functional and basis set can affect the accuracy of DFT results. Therefore, it is important to validate DFT predictions with experimental data whenever possible.

3. What is an "unexpected result" in the context of DFT?

An unexpected result in DFT refers to a discrepancy between the predicted and experimental values of a property. This could be due to the limitations of the computational method or errors in the experimental measurements. Investigating these unexpected results can provide insights into the accuracy and reliability of DFT calculations.

4. How can DFT be used to examine unexpected results?

DFT calculations can be used to compare the predicted and experimental values of a property and identify any discrepancies. Additionally, the electronic structure of the system can be analyzed to understand the underlying reasons for the unexpected result. This can involve examining the molecular orbitals, charge distribution, and bond lengths, among other factors.

5. How can the findings from investigating unexpected results with DFT be useful?

The findings from studying unexpected results with DFT can have various implications. They can improve our understanding of the limitations and accuracy of DFT calculations, and guide the development of more advanced computational methods. Additionally, they can provide insights into the properties and behavior of molecules and materials, leading to potential applications in various fields, such as drug discovery and materials design.

Similar threads

  • Electrical Engineering
Replies
29
Views
6K
  • Calculus and Beyond Homework Help
Replies
5
Views
5K
  • Calculus and Beyond Homework Help
Replies
8
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
  • Electrical Engineering
Replies
6
Views
1K
Replies
1
Views
725
  • Programming and Computer Science
Replies
1
Views
1K
  • General Discussion
3
Replies
102
Views
7K
  • Electrical Engineering
Replies
3
Views
795
Replies
33
Views
2K
Back
Top