Statistical Pattern in Music: Predictability and Surprise

Audio engineers have known for a long time that music generated by computers sometimes sounds unnatural.  One reason for this phenomenon is the absence of small imperfections that are part of every human activity.  In a recent Physics Today article (July 2012), Holger Hennig, a postdoc at Harvard, and his collaborators described how they analyzed a professional drummer’s deviations from the metronome’s beats, and discovered correlations of the natural rhythmic imperfections.  To characterize the correlations, the researchers performed a power spectrum analysis.  The process is analogous to analyzing radio waves in the atmosphere by setting a radio to different frequencies and listening for how much power comes out at each.  The drummer’s power spectrum S(f) has the form S(f) \propto 1/f^{\alpha} with \alpha \approx 1.  (See Technical Note below for how S is related to the autocorrelation function.)  Sound sequences defined by a power spectrum are what physicists and engineers call “noise.”  (Interestingly, the composer John Cage wrote in his book Silence, “what we hear is mostly noise.  When we ignore it, it disturbs us.  When we listen to it, we find it fascinating.”)  The character of the noise changes significantly if the exponent \alpha is altered.  When \alpha is zero, the noise, called “white noise,” is entirely random as every sound is completely independent of its predecessors.  By contrast, a noise with \alpha=2 produces a far more correlated sequence of sounds which makes the noise rather predictable.


Hennig’s experiment and many other studies reflect the human preference for music with a balance of predictability (\alpha \approx 2) and surprise (\alpha \approx 0).  Back in the 1970s, Richard Voss and John Clarke at Berkeley found the pitch fluctuations in Bach’s First Brandenburg Concerto to obey the 1/f power law.  This year, in a paper published in the Proceedings of the National Academy of Sciences (vol 109, pp 3716-3720), Daniel Levitin, Parag Chordia and Vinod Menon reported similar pattern for the fluctuations of written note lengths in compositions of 40 different composers.  (Beethoven and Vivaldi are among the most predictable, and Mozart is among the least.)

Currently, professional audio editing software offers a humanizing feature that artificially generates rhythmic fluctuations.  However, these built-in functions are essentially random number generators producing only uncorrelated white noise.  The result is a rough ride: a rather bumpy, jerking rhythm.  The Hennig group tried to imitate the human type of imperfection by introducing rhythmic deviations that exhibit the 1/f pattern.  They prepared audio examples of a Bach’s Invention and other pieces, available at, and found that more respondents preferred the 1/f version to its white-noise counterpart.  You can listen to these samples and make a judgment yourself.  Please share your thoughts by posting a comment.

Technical Note: For a time-fluctuating physical variable y(t) such as the drummer’s deviations from the metronome’s beats or Brandenburg Concerto’s output voltage, we can represent it as a Fourier integral y(t)=\int C(f) \cdot e^{2 \pi i f t} \, d f where the Fourier coefficient is C(f)=\int y(t) \cdot e^{2 \pi i f t} \, d t.  (The limits of all integrations in this note are \pm \infty, which we omit writing.)  The autocorrelation function \langle y(t) y(t+\tau) \rangle is a measure of how the fluctuating quantities at times t and t+\tau are related.  It can, like any other function of time, also be expressed as a Fourier integral: \langle y(t) y(t+\tau) \rangle=\int S(f) \cdot e^{2 \pi i f \tau} \, d f, where S(f) is the spectral density of y(t).  This known as the Wiener-Khintchine relations.  The spectral density is proportional to the square of the Fourier coefficient: S(f) \propto |C(f)|^{2} (recall Parseval’s Theorem).  Nowadays it is convenient to use Maple, Mathematica, Matlab, even Excel to perform a fast Fourier transform.  The above simulation of noise was produced by (inverse)-Fourier transforming the product of the power-law spectra and random numbers generated by Mathematica.  It should be quite feasible to ask students to analyze actual musical performances.  I personally am curious about the rhythmic pattern in Glenn Gould’s Bach.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

2 Responses to Statistical Pattern in Music: Predictability and Surprise

  1. Pingback: Round Up! : Footenotes

  2. I’m still reading Murakami’s 1Q84, and one of the protagonists is a math instructor/novelist. There’s a part describing when he first learned a percussion instrument in high school: “He felt a natural joy in dividing time into small fragments, reassembling them, and transforming them into an effective row of tones. All of the sounds mentally appeared to him in the form of a diagram… because the score resembled numerical expression, learning how to read it was no great challenge for him.” Your post is very fascinating, Frank. I’m also personally curious about Gould’s Goldberg Variations!

Leave a Reply

Your email address will not be published. Required fields are marked *