DOI: 10.5061/dryad.rbnzs7hh4
title: Physiological constraints and cognitive chunking in Zebra Finch songs: Data and R script

description: Learned bird songs often have a hierarchical organization. In the case of
 zebra finches, each bird’s song is made up of a string of notes delivered
 in a stereotyped sequence to form a “motif”, and motifs are repeated to
 form a song bout. During song learning, young males copy “chunks” of two
 or more consecutive notes from their tutors’ songs. These chunks are
 represented as distinct units within memory (during learning) and within
 motor systems (during song production). During song performance, motifs
 may deviate from the learned sequence by stopping short, starting late, or
 by skipping, inserting or repeating notes. We measured acoustic and
 temporal variables related to the respiratory and vocal physiology of song
 production and asked how they related to deviations from each bird’s
 “canonical” sequence. The best predictor of deviations from that sequence
 was the duration of the silent interval between notes, when inspiration
 normally occurs. Deviations from the canonical motif occurred less often
 after higher-pitched notes, perhaps because a high-low sequence forms a
 prosodic unit. Premature stops often followed louder and longer notes,
 suggesting that respiratory and muscular physiology influence the location
 of such stops. Boundaries between the learned chunks of a male’s motif
 predicted where and how often non-canonical starts occurred. Physiological
 and cognitive elements also interacted to define the segmentation of zebra
 finch song sequences. Long silent intervals between notes were associated
 both with physiology (inspirations) and with the cognitive boundaries of
 learned chunks – and hence with deviations from the canonical motif.
description: <strong>Subjects:</strong>  The subjects were 50
 adult male zebra finches (<em>Taeniopygia guttata</em>) bred
 and raised in the Williams College colony. Birds were hatched in aviaries
 that housed at least three breeding pairs, and so could copy songs from
 their fathers or from other adult males. Young males in their own and
 other broods could also influence song development (Tchernichovski
 & Nottebohm, 1998) or be the source of song material, and both
 young and older females were present and could influence song development
 (Carouso-Peck & Goldstein, 2019). When birds reached maturity
 (approximately 90 days) they were removed from their natal aviaries and
 housed in single-sex cages, grouped by age cohort, in a colony room that
 also housed females and older males. All procedures were approved by the
 Williams College Institutional Animal Care and Use Committee (Williams
 College IACUC protocol WH-A). <strong>Song
 Recording:</strong>   Recordings of female-directed song were
 obtained by placing a caged adult male (&gt; 120 days) in a closed
 Lucite chamber (75 x 60 x 50 cm) lined on two sides, the top, and the
 bottom with acoustic foam. A caged adult female was placed outside one of
 the transparent chamber walls to elicit directed (courtship) song. A
 Marantz EC-7 dynamic microphone in the chamber was used to record songs
 onto cassette tape (using a Marantz PMD-201 cassette recorder) or
 digitally (Marantz PMD-670 digital recorder; 44 kHz, 16 bit). Songs
 recorded on cassette tape were then digitized using SoundEdit Pro
 (Macromedia), which was also used to produce sound spectrograms for visual
 analysis of song sequences. For greater temporal resolution, 128 point
 FFTs were used. Multiple song bouts and motifs from each male were
 obtained from at least two recording sessions on different days. The mean
 number of motifs recorded and scored for each male was 119 (range =
 59-188). The large number of motifs was required because deviations from
 the stereotyped order, although they occurred in 72% of motifs scored,
 were relatively infrequent at each transition between notes (mean =
 7.4%). <strong>Scoring Motif
 Sequences: </strong> Multiple bouts and motifs sung by each bird
 were examined and annotated in order to find that male’s “canonical
 motif”, defined as the longest stereotyped sequence of notes within his
 songs. Figure 1a shows sound spectrograms of a song bout that includes two
 canonical motifs (the sequence of 12 notes labeled A through N) as well as
 five truncated or altered motifs (notes O-G, OE, AD-N, A-K, H-K). The
 sound file from which this bout is drawn is included in the Supplemental
 Materials. Calls that occurred in other contexts and were only rarely
 appended to the song were not considered to be part of in the canonical
 motif. Zebra finch song units separated by silent intervals have
 traditionally been called “syllables”, and these syllables are often the
 units used in analyzing motifs. However, some syllables consist of two or
 more “notes”, which we define as sounds that are bounded by abrupt
 transitions in frequency or frequency modulation. Notes  are not
 necessarily separated by silent intervals. We used notes rather than
 syllables as the unit of sound analysis because deviations from the
 canonical motif sometimes occurred between notes rather than between
 syllables, and so. Each bird’s canonical motif was represented as a string
 of letters corresponding to the order of its constituent notes (see Figure
 1a). The first note in each bird’s motif was designated with the letter A,
 the second note with the letter B, and so on; hence the letters designate
 the order within a bird’s song rather than the note type. When
 introductory notes or calls were appended immediately after the last song
 note in a motif, but were not then immediately (with 200 ms) followed by
 another motif, they were not included in the string of labeled notes and
 transitions or in the analysis. Using the resulting annotated strings,
 each transition between notes within each bird’s song (where a deviation
 from the canonical sequence might fall) was designated by the notes that
 flanked a silent interval (e.g., start -&gt; A, A -&gt; B, … , M
 -&gt; N). We then tabulated deviations from the canonical motif (see
 Figure 1a for six examples of such deviations). The most common types of
 deviations were a) stops before the canonical sequence was completed (1722
 instances at 199 different locations within 50 birds’ motifs) and b)
 starts at points other than the first syllable of the canonical motif (981
 instances at 50 locations within 28 birds’ motifs). Less common deviations
 included i) repeated notes or short sequences of notes, ii) skipped notes,
 and iii) insertions of notes into the canonical sequence. As each of these
 three types of deviations was relatively rare, we combined them into a
 single category for analysis: c) “other” deviations (675 instances at 84
 locations within 42 birds’ motifs). Different types of deviations
 sometimes occurred at the same location within a single bird’s motif (80
 locations in 44 birds’ motifs). Each individual deviation (and each type
 of deviation) from the canonical motif occurred at a specific transition
 between notes within a bird’s motif. We calculated the number of times
 each type of deviation occurred at each transition point as well as the
 number of opportunities within the bird’s song for such a deviation to
 occur (the number of motifs that included at least one of the flanking
 notes). We could then determine the frequency of each type of deviation at
 every possible transition between syllables within a bird’s canonical
 motif. Figure 1b shows sound spectrograms of each of four birds’ canonical
 motifs. In addition, Figure 1b shows the frequencies of the three types of
 non-canonical transition as both 1) bars within the spectrogram and 2)
 arrows within a network diagram of notes and transitions. A subset of 904
 motifs (including 7,638 notes) sung by 22 of the subjects were scored by
 two individuals to check the reliability of our scoring method. A total of
 2,010 transitions within these motifs were scored as stops, starts, skips,
 repeats, or insertions (most of the stops and starts fell at the beginning
 or end of canonical motifs and were not deviations). We found 27
 discrepancies in the scoring of these 2,010 transitions, which represents
 98.7% agreement in how different individuals scored the notes and
 transitions.  <strong>Learned Chunks and Breaks
 Between Them:</strong>  To investigate the role of cognitive or
 perceptual factors in defining deviation points, we needed to define the
 boundaries of the learned “chunks” of notes that were copied as a unit
 during song development. To do so, we used a subset of 21 males. These
 birds sang songs with related canonical motifs, sharing parts of a “core
 sequence”  but differing in some details of that sequence. By comparing
 sound spectrograms of these birds’ canonical motifs, we were able match
 notes and sequences (see the four related songs in Figure 1c). We
 determined the “core motif sequence” to be nine consecutive notes in the
 song of the male who sang the maximum number of notes common to the 21
 songs (male DB 10; see Figure 2). To find copied chunks of notes, we
 compared the canonical motifs of the other 20 males’ songs to the core
 motif sequence and noted points where the order of the core sequence was
 not followed, because of omissions, additions, or changes in the order of
 notes. The points within each male’s canonical motif where breaks in core
 sequence began and ended were defined as “chunk boundaries” (depicted by
 downward arrows in Figure 2). Some males’ canonical motifs included notes
 prior to before the beginning of the core motif, and one chunk boundary
 occurred prior to the first note of the core motif (W39 in Figure 2; a
 note was inserted immediately prior to the first note of the core
 sequence).  Similarly, some songs did not include the final note(s) of the
 core motif, and so ended at a chunk boundary (e.g. Pk42 in Figure 2) .
 Notes from the core motif sequence were omitted in some songs (resulting
 in a chunk boundary where the omission occurred), and notes were inserted
 into the core motif in other songs (resulting in two chunk boundaries, one
 on either side of the insertion). Based on the analysis depicted in Figure
 2, each of the 158 intervals within the portions of the 21 birds’ motifs
 that matched some portion of the core sequence were scored as having a
 chunk boundary either present or absent. Notes and transitions outside the
 core sequence were not included in analyses that considered the position
 of chunk boundaries. <strong>Measuring the
 Characteristics of Transition Points: </strong> We measured the
 acoustic characteristics of each transition point within each bird’s
 canonical motif (see Table 1 for the measurements and units). Because
 FFT-derived sound spectrograms have an inherent temporal uncertainty due
 to the windowing of data points, timing and duration measures were taken
 from the sound waveform in SoundEdit Pro. To determine the position of an
 interval within a bird’s canonical motif, we measured the time from the
 beginning of that canonical motif to the beginning of the interval, and
 then divided that number by the duration of the entire canonical motif.
 Each interval position measurement thus falls between 0 (the start of the
 motif) and 1 (the end of the motif). To determine the relative amplitude
 of each note, we first normalized the amplitude of a recording of each
 bird’s canonical motif, and then measured the mean amplitude of that
 entire motif and of each note within the motif using SoundAnalysisPro
 (Tchernichovski, Nottebohm, Ho, Pesaran, & Mitra, 2000);
 soundanalysispro.com). The average amplitude of a note was then divided by
 the average amplitude of the motif to obtain that note’s relative
 amplitude, which ranged from 0.7 to 1.35; values greater than 1 correspond
 to notes with higher-than-average amplitude, and values less than 1
 correspond to notes of lower-than-average amplitude. We also used
 SoundAnalysisPro to measure the mean pitch of each note. We also
 classified the notes flanking each interval within a bird’s song into
 three categories (see Figure 3): “downsweep” (a harmonic note that
 decreased by at least 300 Hz in pitch from beginning to end, n = 307),
 “stack” (an unmodulated note with harmonics, n = 151), “high” (notes with
 a mean pitch higher than 2 kHz and no energy apparent below 1.75 kHz in a
 sound spectrogram, n = 57). Some zebra finch note classifications split
 stacks and downsweeps into two categories based on duration, and may also
 define compound syllables that consist of two note types, such as
 “stack-downsweep” (Sturdy, Phillmore, & Weisman, 1999). We scored
 such compound syllables as two different notes. If two successive notes
 formed parts of a single continuous syllable, the duration of the
 inter-note interval was 0 ms. We did not include the position of a motif
 within a song bout in our analysis of deviations from individual birds’
 canonical sequence. We observed deviations from canonical motif sequences
 in all possible positions within bouts: the first, last, and internal
 motifs, within bouts that included multiple motifs, in single-motif bouts,
 and in motifs preceded by varying numbers of introductory notes. However,
 we cannot rule out the possibility that a study of how bout structure is
 related to deviations might find that some aspects of bout structure
 (Hyland Bruno & Tchernichovski, 2019), such as position within a
 bout or number of introductory notes, could be correlated with the
 occurrence of deviations from a bird’s canonical motif sequence.
description: R, with the following packages: ggplot2, Rcpp, Matrix, lme4,
 reshape2, sciplot, lattice, plyr, magrittr, MuMIn, Amelia, pscl, readr,
 performance, dplyr, tidyverse, ggeasy, car, glmmTMB, bbmle, GLMMadaptive,
 sandwich, lmtest, MASS, DescTools (all are open-source)
description: \# **Physiological Constraints and Cognitive Chunking in Zebra Finch
 Songs: Data and R script** The data set for the associated paper was
 obtained by analyzing an average of more than 100 songs from each of 50
 zebra finches. Zebra finches have a stereotyped song consisting of
 approximately ten notes, which are delivered in a stereotyped sequence
 called a motif. The full sequence is the canonical motif. To address the
 question of what physiological and cognitive factors are associated with
 deviations of the canonical motif sequence, we scored deviations as start,
 stop, and other (repeats, skips, insertions) and counted their occurrence
 at each transition between notes in each birds canonical motif. We then
 characterized the acoustic and temporal properties of each transition
 between notes. Finally, we characterized the cognitive chunks within the
 song by looking at 21 birds songs that were copies of the same motif, and
 noting where the copied songs did not match; the transitions where the
 copied song broke from the standard song are called core chunk breaks. \##
 Description of the data and file structure There are two data sets: 1.
 ZFVariationData.csv is the main data set. It includes one row for each
 transition between notes in each birds song, counts and proportions of
 deviations from the canonical motif, whether or not (for a subset of 21
 birds songs) a chunk break occurred at that transition, and the acoustic
 and temporal properties of the transition and flanking syllables. The
 notes in each birds canonical motif were labeled sequentially A,B,C, etc.;
 notes with the same label in two different birds songs have the same
 sequential position in the song but different acoustic properties. In some
 cases, two notes with the same letter have different subscripts (such as
 E1 and E2); these are two distinct notes. Variables include: BirdID (leg
 band); a random number (for alternative sorting); the song type (A =
 related songs for which cognitive segmentation is known); syllable pair
 (the syllables bounding a silent interval within the song and so defining
 the interval); whether or not there is a chunk break (cognitive segment,
 applies to type A songs); total # of motifs scored; corrected motifs (no.
 motifs that included the specific interval); total deviations (for all
 locations in all motifs for that bird); local deviations (deviations from
 the canonical motif at the specific interval between the syllable pair);
 dominant deviation (the type of deviation that occurred most often);
 Deviation (whether or not one occurred at that interval); StartNo (number
 of starts after the interval); Start (whether or not any starts occurred
 at that interval); StopNo (number of stops at the interval); Stop (whether
 or not a stop occurred at the interval); OtherNo (number of other types of
 deviations at the interval); Other (whether or not an other type of
 deviation occurred at the interval. The next three columns give the
 proportion of deviations per corrected motif, the log of that measure, and
 the log of that measure + 1. The next nine columns provide the same
 calculated measurements for start, stops, and other deviations (proportion
 at that interval, log of the proportion, and log of the proportion +1).
 The duration (in seconds) of the syllables preceding (Pre) and following
 (Post) the intervals come next. Motif Duration is followed by Interval
 Position within the motif (on a scale of 0 to 1 as a proportion of the
 motif). Interval duration is self explanatory, and a constant (1) was
 added to the number of ms in that duration before taking the log of that
 value for the following column. The pitch of the preceding note (PitchPre)
 is in Hz, and the next column is the logarithm of that value. Similarly,
 the pitch of the following note (PitchPost) is followed by the log of that
 value; deltaPitch is the difference between the following note and the
 preceding note. AmplitudePre and AmplitudePost refer to the amplitude of
 notes preceding and following the interval, respectively, and
 deltaAmplitude is the difference between the two. PreNoteType and
 PostNoteType give the observer-designated note types for the preceding and
 following note types, respectively, and NoteTransition has a two-letter
 designation for the two note types that surround the interval. NOTE: There
 are many NA entries in this data table. This occurred for two reasons. 1)
 In most columns that represent the log of a measure, values of 0 for the
 measure result in an NA for the log of that measure (the exception being
 variables for which a constant value of one was added before taking the
 logarithm; see above and methods). 2) For each interval, measurements of
 syllables that preceded and followed the interval are provided. However,
 for some intervals in the song, there may be no preceding or following
 notes, and so these values appear as NA. 1. ZFscorecomparisons.csv is a
 data set used to test whether results (in the form of z scores) from the
 entire dataset are consistent with the results from the 21 songs in chunk
 break subset (SongTypeA), and the subset of the 29 remaining songs
 (NonASongs). The measure and deviation type columns are self-explanatory.
 There is also one R script: ZFPhysiologyCognitionFinal.R recapitulates all
 of the data analyses reported in the paper and also reproduces the figures
 from the body of the paper. It calls on both of the data sets described
 above. \## Sharing/Access information Data can also be obtained from the
 corresponding author (). All data were
 generated from original research by the authors, and should be credited
 with a citation to the published paperin the Journal of Comparative
 Psychology and to this database. \## Code/Software Base R was used, with
 the following packages:ggplot2, Rcpp, Matrix, lme4, reshape2, sciplot,
 lattice, plyr, magrittr, MuMIn, Amelia, pscl, readr, performance, dplyr,
 tidyverse, ggeasy, car, glmmTMB, bbmle, GLMMadaptive, sandwich, lmtest,
 MASS, DescTools.