This application uses Fast Fourier Transform (FFT) to transform a complex vector in the frequency domain (top view) into a complex vector in the time domain (bottom view), and vice versa. This project was inspired by Dave Hale's famous (and by now pretty aged) FFT Laboratory Java applet from 1996. It is a complete reimplementation of said project in vanilla JavaScript (ECMAScript 5+), and extends the original ideas by adding polar coordinate views, waveform synthesis for auralization, folding for time domain channel separation, additional editing tools, and vertical zooming. It is optimized to demonstrate FFT operations in connection with audio, but can of course as well be used to demonstrate the concept in other fields of interest (like image, video, FFT algorithm tests, etc). The application is platform-agnostic and should run on any operating system. It has been tested on Firefox (version 34), Chromium (version 39), Internet Explorer (version 11), and the integrated browser of the Eclipse Web Tools Platform (version Luna). Note that both the Eclipse Browser and Internet Explorer do not yet support the Web Audio API, therefore the auralization feature is not available on these browsers. Internet Explorer 11 also fails to contain SVG graphics elements inside their parent elements due to a browser bug, therefore lollipops may appear all over the screen; you can work around it by using less zoom, or by using a different Web Browser.
Each section consists of two lollipop editors that display/modify a vector of complex numbers. In the cartesian view (default), these two represent the real (left) and imaginary (right) parts of the vector's elements. In polar view (switch using button to the left of the section) these two represent absolute values (left) and argument angels (right). Note that the polar view allows entering "negative absolute values", which are interpreted as positive absolute values with an additional argument angle offset of π. It also allows editing argument angles outside range [-π, +π[, which are renormalized into said range. Pressing the auralization button converts the associated complex vector into a stereo clip and continually loops over it with a sampling rate of 11025Hz, four times slower than usual in order to pitch down the waveforms by two octaves.
The lollipop waveform editors support the following editor modes: The pencil is designed to edit multiple values while keeping the mouse button pressed. The sticky pencil is designed to modify one sample in great detail, without loosing grip on it. The rotor tool allows the samples to be rotated to the left of right (single channel), while the mirror tool allows them to be mirrored at the horizontal axis. The eraser tool erases single values, while the reset button resets all values of both sections to zero.
The fold button causes a folding operation to be performed before Fourier transforming the values from the frequency to the time domain (top to bottom), and a corresponding unfolding operation after inverse Fourier transforming the values from the time to the frequency domain (bottom to top). This untangles the frequency domain values into a stereo spectrum, effectively using only a single O(N*logN) Fast Fourier Transform plus one O(N) folding operation. In fold mode, the left half of the complex values in the frequency domain (both editors) represent the spectrum of the left channel in the time domain (with ascending frequencies), while the right half of said values represents the corresponding spectrum of the right channel in the time domain (with descending frequencies); the values are best viewed in polar coordinates. The complex values at index zero and ½N combine 0Hz (real part) and the Nyquist Frequency (imaginary part) of their respective channel.
Please contact sascha.baumeister@gmail.com in case of problems or bugs.