1 Introduction
Birdsong is often described as "singing", yet the ear cannot resolve trills of a dozen notes per second or pitch glides that last a few tens of milliseconds. A spectrogram draws sound as an image of time, frequency and level, and it is a basic tool of bioacoustics and phonetics. Sonic Visualiser was developed at the Centre for Digital Music, Queen Mary University of London, as an application for visualising, analysing and annotating audio recordings, and it is released under the GNU GPL version 2 or later [1][2][3].
This article is not a tour of the user interface. It uses checkable data to answer a practical question: when an ordinary user turns birdsong, whistling and speech into pictures with this free program, which quantities can be read reliably, how large are the errors, and which default settings can mislead?
We addressed four questions:
- RQ1: On real recordings, are SV's spectrograms numerically correct and reproducible, and are annotations stored without loss?
- RQ2: How well does a simple fixed-threshold automatic segmentation of the SV spectrogram agree with a visual reference annotation made by the AI analyst?
- RQ3: How do birdsong, whistling and speech differ in frequency, duration and structure? Can birdsong be "counted in notes"?
- RQ4: How does the spectrogram window length affect what one reads from fast bird notes?
2 Materials and methods
2.1 How the study was run and what data were used
- Execution: the target software was actually run, and every result was checked independently in Python.
- Data: the core data are public excerpts of four real recordings. Synthetic signals with known truth (algorithmically generated bird-like and whistle-like sounds, section 2.7) were added for the window-size experiment and for calibration. These synthetic signals do not represent any real bird species.
2.2 Software and environment
The software tested was Sonic Visualiser 4.5.2 (Ubuntu package 4.5.2-2build3) with the Vamp SDK example plugins 2.10.0. It ran on Ubuntu 24.04.5 LTS under an Xvfb virtual display. The current release on the official website is 5.2.1, published on 2025-03-21 (accessed 2026-11-22) [1][2], so our conclusions may not carry over unchanged to version 5.x. The checks used Python 3.13, NumPy 2.5.3, SciPy 1.18.1 and librosa 1.0.1, including the pYIN fundamental-frequency estimator [4].
2.3 Recordings, excerpts and licences
| ID | Content | Excerpt | Source and licence |
|---|---|---|---|
| spinetail | Red-faced spinetail Cranioleuca erythrops, four songs | whole file, 19.5 s, 44.1 kHz | scikit-maad example data [5], repository licence BSD-3-Clause |
| mockingbird | Northern mockingbird Mimus polyglottos | first 30 s (mean of both channels), 48 kHz | ZooFari, Wikimedia Commons, CC BY-SA 3.0 [6] |
| whistle | Human whistling (melody of "La donna è mobile") | whole file, 8.9 s, 44.1 kHz | Stanislav Kozlovskiy, Wikimedia Commons, CC BY-SA 4.0 [7] |
| speech | Adult male, US English, read news | 17.6–27.6 s, 44.1 kHz | speaker Turtlestack, Audio Wikinews, Wikimedia Commons, CC BY 2.5 [8] |
Each excerpt was only decoded, averaged to mono and cut. Nothing was resampled, filtered or gain-adjusted. The speech excerpt skips the opening jingle and the introduction, which has background music. About 30% of the frames in the mockingbird excerpt are digital silence (the original file may have been edited or noise-gated); these frames were excluded when estimating the noise floor. All licences were checked on the recordings' Commons file pages or repository (accessed 2026-11-22). Because the mockingbird (CC BY-SA 3.0) and whistling (CC BY-SA 4.0) recordings are share-alike, the figures in this article that are derived from the recordings (Figures 1–5) are shared under CC BY-SA 4.0.
2.4 Operating Sonic Visualiser
On first start, SV asks for permission to use the network, which includes OSC remote control. Batch processing with --osc-script works only if this permission stays enabled. SV was started once per recording, and the script then:
- opened the audio and added a spectrogram layer (default: 1024-point Hann window, 50% overlap);
- exported the spectrogram values and SV's own rendering of it;
- ran the Vamp example plugins (spectral centroid, amplitude follower and percussion onset detector) and exported their outputs;
- took a screenshot and saved the session.
The whole batch was run twice (runA and runB). Annotations were written as "regions" layers in SV session files, with the reference annotation in the upper pane and the automatic segments in the lower pane. Each session was opened and captured on screen, then each layer was selected with /setcurrent and exported, to check that the round trip was lossless.
2.5 Reference annotation and automatic segmentation
Reference annotation. The AI analyst produced the reference annotation and froze it before any comparison was made; its SHA-256 is recorded in S6 Data. The analyst inspected each spectrogram and envelope sheet, drawn on a 50 ms grid, and marked "events" of the target sound source. Consecutive events had to be separated by a visible gap of at least 50 ms. Slow glides of other bird species and insect sounds in the spinetail recording were not annotated. In total there are 84 events (spinetail 21, mockingbird 42, whistle 15, speech 6). Visual reading precision is estimated at about ±20 ms. This is not an annotation by a human expert; the annotation (S2 Table) and the SV session files (S2 Data) are provided so that it can be checked. Note that an "event" is an acoustic unit bounded by gaps: a whole spinetail song counts as one event, while the elements inside a song (section 3.4) are counted separately.
Automatic segmentation. The rule was also fixed in advance:
- the total energy of each frame of the SV-exported spectrogram is computed, and its 10th percentile is taken as the noise floor;
- frames more than 10 dB above the floor count as sound;
- gaps shorter than 50 ms are bridged, and events shorter than 20 ms are discarded.
Events were matched one-to-one by onset within ±50 ms, and precision, recall and F1 were computed.
2.6 Independent checks in Python
- Numerical check: an STFT with a periodic Hann window and SV's frame alignment was compared element by element with SV's exported matrix.
- Independent segmentation: the same rule was applied to a 5 ms waveform RMS envelope.
- Pitch check: for whistling and speech, pYIN fundamental frequencies were compared with the median frame-wise peak frequency of the SV spectrogram.
2.7 Window-size experiment and synthetic calibration
The following sounds were loaded into SV sessions with window sizes of 256, 512, 1024 and 2048 samples (50% overlap) and rendered and exported by SV:
- five synthetic bird-like clips, each with 2–3 downward sweeps of 104–137 ms and 8–12 trill notes of 45 ms, 66 notes in total, all with known sweep widths;
- the real spinetail recording.
Two measures were computed. The "sweep capture" is the ratio of the sweep visible in SV to the true sweep within the central 60% of each note. The second measure is the frequency error at the note centre. Calibration reuses the 15 synthetic clips (91 notes with known truth) from version 1 of this study.
All result tables, Sonic Visualiser sessions and exports, scripts and logs are provided as supporting information (S1–S4 Text, S1–S9 Table, S1–S6 Data and S1 Code).
3 Results
3.1 Spectrograms of the three kinds of sound
Figure 1. Spectrograms of the four real recordings, computed and exported by Sonic Visualiser 4.5.2 (Hann window 1024, 50% overlap). Colour: level in dB relative to the maximum of each panel (70 dB range). Measured data.
Figure 2. Screenshot of Sonic Visualiser 4.5.2 during this study (red-faced spinetail). Top pane: waveform with the reference annotation (purple regions R1-R21). Bottom pane: spectrogram with the automatic segments (orange regions A1-A22). Measured data.
The four sounds are easy to tell apart (Figure 1):
- Spinetail: each song is a dense row of vertical strokes that drifts slowly down from about 7 kHz, interrupted now and then by high notes that plunge from above 10 kHz.
- Mockingbird: syllables sit between 2 and 4 kHz, and the bird usually repeats one syllable type several times before switching to the next.
- Whistling: an almost single line near 1 kHz, with a faint second harmonic above it.
- Speech: within the displayed 0–5 kHz range, many parallel harmonics alternate with broadband consonant stripes.
Figure 2 is a real screenshot of SV during the study, showing the reference annotation and the automatic segments side by side.
3.2 Numerical agreement, reproducibility and annotation round trip (RQ1)
| Check | Result |
|---|---|
| SV spectrogram vs Python STFT with the same parameters (4 real recordings, including 48 kHz) | maximum absolute difference 4.97×10⁻⁷; minimum r 1.00000000 |
| 24 SV exports from the window-size experiment vs Python | maximum absolute difference 5.11×10⁻⁷; minimum r 1.00000000 |
| runA vs runB (4 recordings × 4 export types) | 16/16 identical |
| Regions written to a session → exported by SV | 8/8 layers, 160 regions identical (error < 0.1 ms) |
The differences are at the level of 16-bit quantisation and single-precision arithmetic, so the outputs can be treated as numerically identical. In other words, SV's spectrogram is a standard short-time Fourier transform, and its exported values can be used directly for quantitative work.
3.3 Automatic segmentation versus the reference (RQ2)
Figure 3. Reference events (grey) and automatic segments from the SV spectrogram (colour) for each recording, with precision, recall and F1 at an onset tolerance of 50 ms. Measured data.
| Recording | Reference / automatic events | Precision | Recall | F1 (SV) | F1 (independent Python) | Median onset error |
|---|---|---|---|---|---|---|
| Spinetail | 21 / 22 | 0.82 | 0.86 | 0.84 | 0.83 | 18.2 ms |
| Mockingbird | 42 / 28 | 0.93 | 0.62 | 0.74 | 0.81 | 11.3 ms |
| Whistling | 15 / 11 | 0.91 | 0.67 | 0.77 | 0.82 | 8.9 ms |
| Speech | 6 / 15 | 0.33 | 0.83 | 0.48 | 0.63 | 13.0 ms |
Once an onset was matched, its error was only about 9–18 ms, comparable to the frame step (11.6 ms). The disagreements came mainly from events being split or merged (Figure 3):
- Mockingbird and whistling: reverberation or background sound between syllables stayed above the threshold, and several syllables were merged into one event, so recall was low. The mockingbird recording has a very low noise floor, which makes its threshold very low too.
- Speech: brief dips between words were treated as gaps, and one phrase was cut into several pieces, so precision was only 0.33.
A single energy threshold finds where a sound starts, but it cannot reliably decide what counts as one unit. Offsets show this clearly: for speech the median onset error was 13.0 ms, but the median offset error was 540.3 ms. The F1 values therefore measure how well the automatic onsets agree with this study's reference annotation (made visually by the AI analyst under the event definition above). They are not detection accuracies against true vocal events, and they do not imply that offsets and durations are equally accurate. SV's example plugin, the Simple Percussion Onset Detector, reported 9, 63, 5 and 6 onsets for the four recordings, which do not match the reference counts (21, 42, 15 and 6) either.
3.4 Comparing the sounds, and the acoustic elements of birdsong (RQ3)
Figure 4. (a) Duration and median peak frequency (SV spectrogram) of all 84 reference events. (b) For pitched sounds, the SV peak frequency against the fundamental frequency from the independent pYIN tracker; dashed line y = x. Measured data.
| Recording | Events | Median duration | Median peak frequency | Energy band 5–95% (median) |
|---|---|---|---|---|
| Spinetail | 21 | 0.13 s | 7171 Hz | 6675–9819 Hz |
| Mockingbird | 42 | 0.28 s | 2578 Hz | 2250–2906 Hz |
| Whistling | 15 | 0.29 s | 1077 Hz | 1034–1120 Hz |
| Speech | 6 | 1.04 s | 86 Hz | 86–4630 Hz |
- Birdsong can be counted element by element. Each of the four spinetail songs lasted 1.94–2.22 s and contained 27–30 identifiable acoustic elements (counted in SV's 256-point export). Converted from the median interval between element onsets, the local tempo was 13.5–15.0 per second; dividing the number of elements by the song duration gives a mean rate of 12.2–14.3 per second. The ear hears only a continuous trill, but the picture lets you count the elements one by one. These elements are not musical notes, though: each is a fast downward sweep rather than a fixed pitch (Figure 5c).
- Whistling is closest to musical notes. SV's peak frequency and the pYIN fundamental differed by a median of 28.4 cents (maximum 49.6 cents), and 15/15 notes were within 50 cents. Most of this error comes from the roughly 43 Hz bin spacing of the 1024-point window, which is about ±37 cents near 1 kHz.
- "Frequency" must be defined first. For fast-sweeping bird notes, "the median of the frame-wise peak" and "the peak of the whole-event average spectrum" are different quantities. They differed by a median of 57.3 cents for the spinetail and 49.8 cents for the mockingbird, and by as much as 1137.8 cents, close to an octave, for one element.
- The loudest frequency of speech depends on the voice. For this male newsreader, SV's peak frequency sat close to the fundamental: the peak-to-fundamental ratio was 1.02–1.36, with fundamentals of 76.0–114.6 Hz. In the synthetic speech of version 1, the peak was 4.3–6.1 times the fundamental. The brightest frequency in a spectrogram should not be taken as the pitch.
3.5 The effect of window length (RQ4)
Figure 5. Window-size experiment in Sonic Visualiser. (a) Fraction of the true frequency sweep visible within the central 60% of each synthetic note (median and interquartile range). (b) Mean absolute frequency error at the note centre. (c, d) The same real spinetail trill rendered by SV with windows of 256 and 2048 samples. Panels a-b: simulation with known truth; c-d: measured data.
| Window (samples) | Time step | Bin spacing | Trill sweep capture | Downsweep capture | Trill centre error |
|---|---|---|---|---|---|
| 256 | 2.9 ms | 172 Hz | 0.92 | 1.00 | 16.3 cents |
| 512 | 5.8 ms | 86 Hz | 0.80 | 0.89 | 13.5 cents |
| 1024 (default) | 11.6 ms | 43 Hz | 0.36 | 0.81 | 15.0 cents |
| 2048 | 23.2 ms | 22 Hz | 0.00 | 0.54 | 22.4 cents |
A longer window gives finer frequency bins, but each frame also spans more time, so the sweep of a short note is smeared out.
- SV's default 1024-point window showed only 36% of the true sweep of a 45 ms trill note.
- At 2048 points only about one frame fell inside the central part of each note, the sweep disappeared entirely, and the centre-frequency error actually grew.
- Figures 5c and 5d show the same real spinetail trill. At 256 points each element is a crisp downward stroke; at 2048 points it becomes a blurred vertical block.
For fast sweeps lasting a few tens of milliseconds, as in this experiment, about 512 points gives the best balance between frequency error and a faithful sweep, and 256 points shows the shape most clearly.
3.6 Calibration with synthetic signals
Figure 6. Calibration with 15 synthetic clips (91 notes) of known truth from version 1 of this study. (a) SV median peak frequency against the true frequency. (b) Frequency error per note for SV (1024-point) and a high-resolution Python estimate. Simulation with known truth.
On synthetic signals with known truth, note frequencies measured from SV's 1024-point spectrogram had a mean absolute error of 14.1 cents for bird-like notes (66 notes) and 16.5 cents for whistle-like notes (25 notes). The note count was correct in all 10 clips that had a truth, and the two runs agreed on 60/60 exports (Figure 6). The precision limit for frequency readings on the real recordings is therefore set mainly by the window and bin spacing, not by the program itself.
4 Discussion
Do birds sing in notes? In a spectrogram, yes, but the meaning differs from a musical score.
- The spinetail's song is built from countable discrete acoustic elements, at a local tempo of about 14 per second.
- The mockingbird's song is built from runs of repeated syllables.
SV draws, annotates, exports and counts both kinds of unit cleanly. A bird's acoustic element, however, is often a fast sweep; it is the whistled notes that come close to fixed pitches. Calling birdsong "notes" helps understanding, but the shape of the frequency track should be read as well.
Assessment of SV.
- Strengths: the computation is reliable (numerically equivalent to an independent STFT implementation within floating-point precision), the results are reproducible (byte-identical across two runs), and annotations are stored without loss. The whole workflow can be automated with OSC scripts and session files, and results can be exported as CSV for checking in other tools.
- Caveats: the default 1024-point window suits pitch but not the shape of short bird notes. The bundled example plugin is not suited to segmenting birdsong. Single-threshold automatic segmentation is only a first draft that still needs human review.
- Define the measure before reading: when reporting "the frequency of a birdsong", state whether it is the fundamental, the frame-wise peak or the peak of the average spectrum.
Practical guide to the window length (for recordings at 44.1–48 kHz): for sounds with a steady pitch, such as whistling or speech, the default 1024 points is enough. To see the shape of short bird notes and trills lasting a few tens of milliseconds, use 256–512 points. Use 2048 points only when closely spaced steady frequencies must be separated, and accept that time detail will blur.
5 Limitations
- Reference annotation: it was made by an AI analyst through visual inspection, not by an expert in bird acoustics. Its precision is about ±20 ms, and event boundaries involve judgement where the picture is ambiguous.
- Small sample: the real recordings cover two bird species with one recording each, one whistler and one speaker. Song elements from the same recording are not independent samples, so the statistics are descriptive only.
- Compression and editing: the mockingbird and whistling recordings are lossy (Ogg Vorbis). The mockingbird recording contains stretches of digital silence, and 0.3% of the samples in the whistling recording are clipped.
- Software version and settings: only SV 4.5.2 on Linux was tested. The window experiment varied only the window length; overlap, oversampling and SV's peak-frequency spectrogram were not tested.
6 Conclusions
Under the conditions of this study, Sonic Visualiser turned real birdsong, whistling and speech into measurable images reliably and reproducibly. Birdsong really can be counted note by note in such an image; the spinetail's local tempo is about 14 acoustic elements per second, each one a fast sweep. To read them accurately, shorten the window from the default 1024 to 256–512 samples, and state in advance which "frequency" is meant.