Description Usage Arguments Value Note Examples
View source: R/measure_signals.R
This function lets the user select bounding boxes to get statistics of the signals of interest in a sound file.
| 1 2 3 | 
| 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. | 
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. 
 For the dBFS_range argument, the code uses the maximum of the values inside the selected region and saves as a resulting signal the values that fall between (maximum - dBFS_range) and the maximum. A selected region with a maximum value of -5 and dBFS_range set to 30 will consider the area with values between -35 and -5 dBFS as a signal. 
The function creates a folder dfreq where it saves csv files with the results of the function dfreq from seewave. The name of each file is coded as: wavfile.samplenumber.csv
| 1 2 3 4 5 6 7 8 | ## 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)
	
## End(Not run)
	
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.