Skip to contents

Rthoptera provides interactive Shiny applications for standard analysis of insect sounds. The package is intended to be used on high signal-to-noise recordings, helping researchers make standardized measurements and plots to support the scientific description of the “acoustic type”. We define “acoustic type” as the first description of the calling song of a species, which should be accompanied by a high-quality recording and the catalog number of the voucher specimen. For the convenience of users, we have included functions for pre-processing audio files, which are already available in other packages (e.g., tuneR, seewave), but here they are interactive (Shiny apps). Most of the plotting functions are based on the seewave package, with the convenience of presets and automatic parameter selection (e.g., window length for the spectrograms) to ensure clarity in any Wave regardless of the recording settings. Most of these plots also have interactive versions which can be saved as HTML documents.

Preprocessing

Please visit the Preprocess page for guidance on how and when to use these tools.

  • Import: Browse your local data to import audio files (WAV) as Wave objects into R. During this process, the waveform is centered to zero with the rmoffset() function to ensure accurate measurements.

  • Downsample: When required and appropriate, you can reduce the sampling rate of your audio files. This helps improve the computing speed for certain analyses and plots without losing important sound features.

  • Band-pass Filter: When necessary, apply a user-defined high-pass and/or low-pass filter to eliminate noise or non-target sounds from your audio recordings.

  • Trim: Using an interactive oscillogram, you can visually select and trim specific sections of a Wave object. The trimmed sections can be saved as new Wave objects in your R environment for further analysis.

  • Merge: Useful when one needs to concatenate several wave files together for certain analyses.

Analysis

Once preprocessing is complete, users can launch analysis tools to extract spectral and temporal statistics from your audio files:

  • Spectral Statistics: Automatically calculate spectral metrics based on the mean power spectrum of a Wave object.

  • Temporal Statistics: Automatically extract temporal metrics from your audio recordings. This includes identifying and analyzing elements (“tooth impacts”), trains (syllables), and echemes (groups of syllables or trills) in the insect sounds. Two apps are available:

  • call_stats_hq is optimized to work with “tonal” (i.e., “high-Q”) signals, such as those produced by most crickets. It creates an envelope of the waveform and measures the duration of trains (i.e., “pulses”) and gaps based on a user-defined detection threshold, then aggregating them into motifs (i.e., “echemes”) and, optionally, into motif sequences.

  • call_stats_lq works better for broadband calls usually produced by katydids, bush-crickets, water-bugs, etc, including those with wide amplitude variability, where the threshold approach would leave fainter sounds undetected or poorly measured. The main difference with the “hq” app is the granularity: this app detects each peak in the envelope, often corresponding to a single tooth impact, and groups them into trains (e.g., “pulses”, “syllables”), motifs (e.g., “echemes”), and motif sequences using user-defined thresholds.

Plotting

  • Multi-Power Spectrum: An interactive tool that overlays multiple power spectrum plots selected from the oscillogram, allowing for easy comparison and visualization of spectral features across different time intervals. Each selection is assigned to its own color (colorblind-safe) both in the oscillogram and the mean spectrum plots.

  • Spectrogram: Generate standard spectrograms, optionally alongside a lateral mean power spectrum. This combination allows you to visualize both time-frequency representations and the overall spectral distribution. The spectrogram window size is automatically adjusted based on the sampling rate and duration of the recording to obtain a standard frequency/time resolution trade-off.

  • Multi Plot: A combined visualization of the spectrogram, mean spectrum, and oscillogram, providing a comprehensive view of both the time-domain and frequency-domain characteristics of the insect sounds.

  • Oscillogram: Create standard oscillograms as well as interactive oscillograms that allow you to zoom in and explore specific sections of the waveform.

  • Multi-oscillogram: Create a stacked oscillogram plot for 0comparing the sounds of multiple species. This is particularly useful for analyzing the differences in acoustic patterns between species.

  • Zoomed oscillogram: Create a static oscillogram with stacked zoomed portions selected interactively.