File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Explain this FFT Radix 2 DIT java code line by line

 
Piotr Orzech
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
can someone explain me this java code line by line on the selected part of the code:



Here is the whole code:

 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yes, but it would be a waste of time for both of us:

1. Assign zero to j.

2. Divide n by 2 and assign the result to n2.

And so on. I don't think that's what you were looking for. Could you perhaps produce a more practical question?
 
Piotr Orzech
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've read about fft and i found few steps how to do this. I don't know how to assign them to this code.

1.Prepare input data for summation — put them into convenient order;
2.For every summation level:
2.1For every exponent factor of the half-period:
2.2Calculate factor;
2.1.1For every sum of this factor:
2.1.2Calculate product of the factor and the second term of the sum;
2.1.3Calculate sum;
2.1.4Calculate difference.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's FFT and DIT? You should always explain abbreviations.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Piotr Orzech
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FFT - Fast Fourier Transfomate
DIT - Decimation In Time

There is some bit reverse (i dont know how it exacly works) and calculation called butterflies. I am begginer in programming and I need a little patiece :P
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piotr Orzech wrote:I am begginer in programming...

Do you understand the mathematics behind FFT and DIT? That is the hard part here. You need to get good grasp of this first and then to analyze code you didn't even write. Trying to understand the algorithm from a foreign code (possibly optimized using clever mathematical tricks, or - worse - even buggy) when you're a beginner in programming would certainly be a frustrating task.

Quick search for "FFT explained" gave me this.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lines 12-18 in the first code look like a standard method for swapping two elements in arrays, but there are two swaps.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic