Investigating an Unexpected Result with DFT: Examining Example 1

  • Thread starter Thread starter btb4198
  • Start date Start date
  • Tags Tags
    Dft Example
Click For Summary

Discussion Overview

The discussion revolves around an unexpected result encountered when using the Discrete Fourier Transform (DFT) in a specific example. Participants are examining the behavior of the DFT, particularly in relation to the expected output for certain input signals, and exploring the implications of normalization factors in the DFT calculations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant shares a link to an example of DFT and expresses confusion over why a specific output value was not as expected, questioning if there was an error in the example.
  • Another participant notes that the DFT spectrum can repeat and that the expected values can be seen in specific frequency bins.
  • A participant expresses uncertainty about the interpretation of expected results from the DFT and seeks clarification on the normalization factor (1/N) used in the calculations.
  • Discussion arises regarding the necessity of the normalization factor, with some participants noting that it can vary depending on the derivation used.
  • One participant asks about the result of adding two signals of the same frequency and how it affects the DFT output.
  • A response explains that the DFT of two signals with the same frequency results in a peak at that frequency equal to the sum of their amplitudes.
  • Another participant expresses skepticism about the DFT's reliability, citing multiple examples that do not yield expected frequencies.
  • A participant shares a MATLAB example to illustrate the DFT process, while another participant critiques the MATLAB output as incorrect based on their manual calculations.
  • There is a request for a manual calculation to verify the results, indicating a desire for clarity on the discrepancies observed in software outputs.

Areas of Agreement / Disagreement

Participants express differing views on the correctness of the DFT outputs, with some supporting the validity of the DFT while others question its reliability based on their experiences. There is no consensus on the interpretation of the normalization factor or the correctness of the MATLAB results.

Contextual Notes

Participants mention various normalization practices in DFT calculations, indicating that different derivations may lead to different scaling factors. There is also a lack of clarity regarding the expected outputs for specific input signals, which contributes to the ongoing confusion.

btb4198
Messages
570
Reaction score
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
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.
 
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?
 
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.
 
what happened if you add two signals with the same frequency together ?
 
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] .
 
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
 
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)))
 
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?
 

Similar threads

  • · Replies 29 ·
Replies
29
Views
7K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
20
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 6 ·
Replies
6
Views
6K