# Synthesizing Snowy Tree Cricket Chirps via Direct Digital Synthesis¶

## Introduction¶

Cricket chirps can be quite complicated. However, an extremely convincing simulation can be generated with a rather simple model. In the figure below, which I've copied from Franz Huber and John Thorson's 1935 Scientific American Article Cricket Auditory Communication, you can see the mechanical means by which the cricket generates a chirp on the left and a time-domain chirp recording on the top right (a). Beneath a are a series of temporal patterns that Huber and Thorson synthesized in their experiment. The pattern in b captures the features of the natural song, and the other patterns (c, d, and e) modify the pattern in one way or another. Perhaps unsurprisingly, Huber and Thorson found that female crickets respond most reliably to the pattern in b. The experiment that they setup to test this is fascinating, and you should read about it in their paper.

We will be synthesizing a variation on the pattern shown in b. A cricket chirp will be composed of some number of syllables (the precise number varies from species to species). Each of these syllables is a pure, amplitude-modulated tone of a species-dependent (and, fasinatingly, temperature-dependent) frequency. These syllables are repeated after a brief amount of time (called the "syllable repeat interval"), and then the whole chirp is repeated again after a longer amount time called the "chirp repeat interval." This chirp repeat interval is the amount of time that it takes for the cricket to open its wings to reposition the file and scraper. The degrees of freedom in this song include:

• The number of syllables
• The frequency of a syllable
• The length of a syllable
• The length of the syllable repeat interval
• The length of the chirp repeat interval

As you vary these degrees of freedom, you can produce simulations of different species of cricket. We will focus in particular on the snowy tree cricket.

## Decomposing the snowy tree cricket song¶

Because snowy tree crickets change their song based on temperature, we'll pick a particular cricket to emulate. In particular, we'll aim to synthesize the cricket in the video below. We can use an oscilloscope to observe the audio waveform generated by this cricket in order to determine each of the degrees of freedom listed in the introduction section.

The synthesized song (constructed incrementally in this document), sound like this:

In [46]:
Audio(song, rate=40000)

Out[46]: