# Period of repetition & state transitions

Period-of-repetition is somewhat similar to the concept of a song motif in that it is a repeated unit; it is an estimate of the typical interval duration between two consecutive renditions of similar sounds. A song motif, however, may contain repeating sounds, so the two measures may differ (*SAP2011* does not calculate *motif duration* -- only *period*). Earlier we presented the similarity score as a mean of evaluated similarity between two different sounds base on the *Euclidean distance* between their features. The same idea can be applied for finding similar sections within a single interval of sound (typically, a long one): We start by choosing a frame of sound (insert point) at a random location within an interval of sound outlined by the user and observe the features in a 70ms window around it. A ‘silence’ is not allowed to be an insert point. We first need to depart from the insert point by moving the window forward in time until we encounter sound that is different enough from the original sound to meet a *similarity rejection threshold*. The default value is 75% similarity. We then keep sliding the window until we find a sound that is similar to the insert point to meet a *similarity acceptance threshold*. The default is 95% similarity. To obtain a stable estimate of the typical period, *the algorithm *examines a random sample of 50 random *insert points*, and measures the interval between each*insert point* and the next rendition of a similar sound. The output is the median of those measurements; that is, it is an estimate of the typical *period* of sound repetition. To obtain a good estimate of the time interval between two similar renditions you will need to outline a relatively long sound interval. We cannot tell you exactly how long the interval should be – but it should contain several renditions of syllables, e.g., 10s is reasonable for most bird songs. You can combine several song bouts into one file and then calculate the period. The stability of the measurements should be validated experimentally (e.g., try it on different samples of sounds and make sure that the results are similar). To sum up, *Period is an estimate of the* typical interval between two occurrences of ‘the same’ sound, starting from a random insert point (anywhere in the outlined interval).

** **

In addition to the period measure, *SAP2011 *also calculates ‘random period’ measure: here instead of progressing from the insert until we find a match, *SA+* makes a random search in the outlined interval, until it finds a matching sound. In the ideal case of fully periodic syntax, e.g., 2,3,4,5,2,3,4,5,2,3,4,5… and given an insert of 5, the odds of obtaining 5 in each random draw is 25%, and the mean random period is 4, which is identical to the period. However, if the sound syntax is 2,2,2,3,3,3,4,4,4,5,5,5,… then the random period will remain 4, but the median estimate of period will be much shorter than the random period.

** **

**Note: both Period and Random-period are based on random sampling of the data, and will never give you the same answer twice. You must compute them several times and make sure that the estimates give you a stable central tendency. **