# Ripple sounds

Ripples are synthetic sounds that have sinusoidal spectral or spectro-temporal profiles. They are commonly used to measure the response properties of neurons in the auditory system, and are frequently compared with visual gratings (see Shamma, 2001). They have also been used to study auditory short-term memory (e.g., Visscher et al., 2007). To create a ripple, we first need to create a mixture of many sinusoids whose frequencies are spaced evenly along a logarithmic frequency axis. Each sinusoid should also have a random starting phase, and their amplitudes should be modified so that the resulting sound has approximately equal power-spectrum density per octave. We're also going to randomise the amplitude of each sinusoid. The resulting sound can be expressed in terms of the time-varying function, , defined by the following set of equations:

Equation 1 sums together sinusoids. Equation 2 generates each sinusoid, and scales and randomises their amplitudes. Equation 3 determines the frequency of the sinusoids in Hz, and ensures that they are evenly spaced on a musical (log2) scale between 250 Hz and 8 KHz. The random variable is the amplitude randomisation applied to the th tone; it is not strictly necessary, so could be set to 1. The second random variable represents the phase of the th tone in radians. The python snippet below implements this process:

Click to hear it:

Notice that all we have done so far is create pink noise, albeit via a rather circuitous method. The spectrogram of the stimulus looks like this:

Notice the lack of any interesting spectral or spectro-temporal features. To add a sinusoidal spectral ripple to the sound, we replace Equation 1 with:

Equation 4 multiplies each sinusoid by an amplitude-modulation function (Equation 5) before summing them. There are now three free parameters: represents the ripple depth — this is set to 1 or 0.9 in most studies; represents the ripple density in cycles per octave; and represents the starting phase of the ripple in radians. The output of the function can be visualised easily:

Here is how to create a spectral ripple in python:

We can see the spectral ripple in the new sound's spectrogram (though due to the linear vertical axis, it is not as clear as in the previous figure):

Now we have succeeded in creating a stationary ripple. However, single-unit recording studies have shown that neurons respond selectively to sounds with specific ripple densities *and* phases (Shamma, 2001). Studies of auditory physiology therefore have often used moving ripple sounds, where the instantaneous phase of the ripple changes over time. We can achieve this by replacing the amplitude-modulation function with a time-varying function:

Equations 6 and 7 replace Equations 4 and 5, respectively. This modification adds a 'drift' to the amplitude-modulation function corresponding to in Hz:

It also adds a striking new perceptual feature to the sound:

Finally, we can go one step further and create dynamic moving ripples (Escabí & Schreiner, 2002). To implement these, we need to slightly modify Equation 7:

Now and are arbitrary vectors of length , describing the instantaneous ripple density and ripple velocity of the sound, respectively.

The code below puts everything together. Note that any of the sounds you heard earlier can be created by passing the appropriate arguments to the ripple_sound() function in this script. A featureless, noise-like sound like the first example is created by setting both and to zero; a stationary ripple like the second example has a non-zero ; and so on.

Here is an example of a dynamic moving sound where and go on independent random walks:

## References

Banner image is *Portrait of Ambroise Vollard* by Pablo Picasso.

- Escabi, M. E. & Schreiner, C. E. (2002). Nonlinear spectrotemporal sound analysis by neurons in the auditory midbrain.
*The Journal of Neuroscience*,*22*, 4114–4131. - Shamma, S. (2001). On the role of space and time in auditory processing.
*Trends in Cognitive Sciences*,*5*, 340–348. - Visscher, K. M., Kaplan, E., Kahana, M. J., & Sekuler, R. (2007). Auditory short-term memory behaves like visual short-term memory.
*PLoS Biology*,*5*, 662–672.