You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* implement cooley tukey in javascript
* Add Ben Chislett to CONTRIBUTORS.md
* add newline at end of file
* make approximate equality check a function in fft-js
* add words to approximation confirmation in fft-js
* attempt to fix bounds on fft-js markdown
In this function, we define `n` to be a set of integers from $$0 \rightarrow N-1$$ and arrange them to be a column.
@@ -101,7 +103,7 @@ M = [1.0+0.0im 1.0+0.0im 1.0+0.0im 1.0+0.0im;
101
103
102
104
It was amazing to me when I saw the transform for what it truly was: an actual transformation matrix!
103
105
That said, the Discrete Fourier Transform is slow -- primarily because matrix multiplication is slow, and as mentioned before, slow code is not particularly useful.
104
-
So what was the trick that everyone used to go from a Discrete Fourier Transform to a *Fast* Fourier Transform?
106
+
So what was the trick that everyone used to go from a Discrete Fourier Transform to a _Fast_ Fourier Transform?
105
107
106
108
Recursion!
107
109
@@ -134,6 +136,8 @@ In the end, the code looks like:
As a side note, we are enforcing that the array must be a power of 2 for the operation to work.
@@ -142,6 +146,7 @@ This is a limitation of the fact that we are using recursion and dividing the ar
142
146
The above method is a perfectly valid FFT; however, it is missing the pictorial heart and soul of the Cooley-Tukey algorithm: Butterfly Diagrams.
143
147
144
148
### Butterfly Diagrams
149
+
145
150
Butterfly Diagrams show where each element in the array goes before, during, and after the FFT.
146
151
As mentioned, the FFT must perform a DFT.
147
152
This means that even though we need to be careful about how we add elements together, we are still ultimately performing the following operation:
@@ -214,8 +219,8 @@ I'll definitely come back to this at some point, so let me know what you liked a
214
219
215
220
To be clear, the example code this time will be complicated and requires the following functions:
216
221
217
-
* An FFT library (either in-built or something like FFTW)
218
-
* An approximation function to tell if two arrays are similar
222
+
- An FFT library (either in-built or something like FFTW)
223
+
- An approximation function to tell if two arrays are similar
219
224
220
225
As mentioned in the text, the Cooley-Tukey algorithm may be implemented either recursively or non-recursively, with the recursive method being much easier to implement.
221
226
I would ask that you implement either the recursive or non-recursive methods (or both, if you feel so inclined).
@@ -242,9 +247,10 @@ Note: I implemented this in Julia because the code seems more straightforward in
242
247
Some rather impressive scratch code was submitted by Jie and can be found here: https://scratch.mit.edu/projects/37759604/#editor
- The image "[FTexample](res/FT_example.png)" was created by [James Schloss](https://github.com/leios) and is licenced under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
266
273
- The image "[radix2positive](res/radix-2screen_positive.jpg)" was created by [James Schloss](https://github.com/leios) and is licenced under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
267
274
- The image "[radix2](res/radix-2screen.jpg)" was created by [James Schloss](https://github.com/leios) and is licenced under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
@@ -271,4 +278,5 @@ The text of this chapter was written by [James Schloss](https://github.com/leios
271
278
##### Pull Requests
272
279
273
280
After initial licensing ([#560](https://github.com/algorithm-archivists/algorithm-archive/pull/560)), the following pull requests have modified the text or graphics of this chapter:
0 commit comments