Book Example 5: Audio Analysis
Audio analysis makes use of the FFT class from the Ess (sound) library in Processing. FFT, or Fast Fourier Transform, allows for the study of the frequency content of a sound clip, which can then be used to perform functions within a program, such as drawing a graph to visualize the sound. The example draws two versions of a spectrogram for an AudioChannel: the first shows the spectrum for the current FFT frame (the sound currently being experienced); the second shows the maximum amplitude achieved in each frequency band so far, decaying over time. The second graph is what is known as a peak hold, a tool used to show how the current signal compares to what came before it. The FFT channels are plotted along a logarithmic scale so that the lower frequencies are farther apart than the higher ones on the right.