Different forms of the discrete Fourier Transform

Click For Summary
The discussion revolves around programming Excel to compute the Discrete Fourier Transform (DFT) of a signal and then reconstructing it after applying a low-pass filter. The user experiences issues with their DFT implementation when transitioning from simple test data to real signal data, resulting in unexpected outputs. They reference a blog tutorial that provided a better transform for real data but noted discrepancies in the transform expressions used. The user seeks insights on potential mistakes when applying the DFT to real data and emphasizes the importance of validating Fourier transform code with known inputs. Testing with a sample file containing multiple cosine terms is suggested as a method for validation.
koab1mjr
Messages
105
Reaction score
0
Hi

I am trying to program excel to take the DFT of a signal, then bring it back to the time domain after a low pass filter. I have a code that can handle simple data for example
t = [ 0, 1, 2, 3]
y = [2, 3, -1, 4]

So I think everything is great and so I plug in my real signal and things go off the rails. Firstly my transform doesn't seem to work. In the simple cases I have a start frequency of 0 and an end frequency of 4. Everything works. I know my data has equal spacing, but I do not know my frequency to start or stop so I pick 0 and some arbitrary numbers. I have the number of points within the frequency interval as variable.

My output looks like no transform I have ever seen and bringing it back to time is equally bad. Am I missing something when I move to real data?

Now I was following this blog http://excelunusual.com/spectral-analysis-a-fourier-transform-tutorial/, as a basis for my code and I found that gave me a decent looking tranform of my real data but failed on a simple problem as stated above. The expression for the transform is different.

G(f) = ∫g(t)e-2π*j*f*t where as most textbooks have n/N in the exponent.

Not sure what the disconnect is but looking for some opinions on this.

Thanks in advance.
 
Last edited:
Mathematics news on Phys.org
Look at the link in my sig and download some code that has been debugged for computing Fourier transforms.

You can also download the file cos10000.txt as a sample input. You will see it is the sum of 5 cosine terms for 10000 points. Testing Fourier transform code on a known input like this is a valuable step in validation.
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K