Skip to content

Commit

Permalink
Merge pull request #1664 from majiang/master
Browse files Browse the repository at this point in the history
improve Fft comments: add description of FFT conventions
  • Loading branch information
dnadlinger committed Oct 29, 2013
2 parents 52c6ecf + 85bd7d1 commit 6dbeb6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions std/numeric.d
Expand Up @@ -2339,9 +2339,9 @@ private:

immutable halfLen = n / 2;

// This loop is unrolled and the two iterations are nterleaved relative
// to the textbook FFT to increase ILP. This gives roughly 5% speedups
// on DMD.
// This loop is unrolled and the two iterations are interleaved
// relative to the textbook FFT to increase ILP. This gives roughly 5%
// speedups on DMD.
for(size_t k = 0; k < halfLen; k += 2) {
immutable cosTwiddle1 = cosFromLookup(k);
immutable sinTwiddle1 = negSinFromLookup(k);
Expand Down Expand Up @@ -2467,6 +2467,9 @@ public:
*
* Returns: An array of complex numbers representing the transformed data in
* the frequency domain.
*
* Conventions: The exponent is negative and the factor is one,
* i.e., output[j] := sum[ exp(-2 PI i j k / N) input[k] ].
*/
Complex!F[] fft(F = double, R)(R range) const
if(isFloatingPoint!F && isRandomAccessRange!R) {
Expand Down Expand Up @@ -2523,6 +2526,9 @@ public:
* the same compile-time interface.
*
* Returns: The time-domain signal.
*
* Conventions: The exponent is positive and the factor is 1/N, i.e.,
* output[j] := (1 / N) sum[ exp(+2 PI i j k / N) input[k] ].
*/
Complex!F[] inverseFft(F = double, R)(R range) const
if(isRandomAccessRange!R && isComplexLike!(ElementType!R) && isFloatingPoint!F) {
Expand Down

0 comments on commit 6dbeb6b

Please sign in to comment.