Learn R Programming

soundecology (version 1.3.3)

measure_signals: Measure a signal or song in a wavefile

Description

This function lets the user select bounding boxes to get statistics of the signals of interest in a sound file.

Usage

measure_signals(wavfile, wl = 512, min_freq = NA, max_freq = NA, min_time = NA,
  max_time = NA, plot_range = 50, dBFS_range = 30, sample_size = 1,
  resultfile = NA, channel = "left")

Arguments

wavfile

a sound file in wav format.

wl

window length for the spectrogram.

min_freq

minimum frequency to draw the spectrogram, in kiloHertz.

max_freq

maximum frequency to draw the spectrogram, in kiloHertz.

min_time

minimum time to draw the spectrogram, in seconds.

max_time

maximum time to draw the spectrogram, in seconds.

plot_range

lower limit of values to plot the spectrogram.

dBFS_range

range of values that is considered a signal, based on the maximum that is calculated. See notes below.

sample_size

number of samples to measure in the spectrogram.

resultfile

name of the file to save the results.

channel

which channel to plot.

Value

The function will open a spectrogram plot to allow the user to click on the regions of interest. Once all the samples are selected, the function saves a file with the values measured in each sample. In addition, the results of the function dfreq of the package seewave are saved on a folder named the same as the wavfile, without the .wav extension.

Examples

Run this code
# NOT RUN {
#Take 5 samples of the file file.wav between 1 - 4 kHz, from 10 to 30 seconds.
measure_signals(wavfile="file.wav", wl=2048, min_freq=1, max_freq=4,
  dBFS_range=30, min_time=10, max_time=30, sample_size=5,
  resultfile="results.csv", plot_range=70)
	
# }
# NOT RUN {
	
# }

Run the code above in your browser using DataLab