track_harm
tracks the frequency contour of the dominant harmonic.
track_harm(wave, f, wl = 512, wn = "hanning", ovlp = 0, fftw = FALSE, at = NULL,
tlim = NULL, threshold = 10, bandpass = NULL, clip = NULL, plot = TRUE,
xlab = "Times (s)", ylab = "Frequency (kHz)", ylim = c(0, f/2000), ...)
A 'wave' object produced by readWave
or similar functions.
Sampling frequency of the wave object (in Hz). Does not need to be specified if embedded in wave.
A numeric vector of length 1 specifying the window length for the FFT, default is 512.
Numeric vector of length 1 specifying % of overlap between two
consecutive time windows, as in spectro
. Default is 0.
if TRUE calls the function FFT of the library fftw. See Notes of the spectro
function.
Default is FALSE
.
Time position where the harmonic frequency contour has to be computed (in seconds). Default is NULL
.
time range in which to measure frequency contours. Default is NULL
(which means it will measure
across the entire wave object).
Amplitude threshold (%) for dominant frequency and detection. Default is 10.
A numeric vector of length 2 for the lower and upper limits of a frequency bandpass filter (in kHz).
A numeric value to select dominant frequency values according to their amplitude in reference to a maximal value of 1 for the whole signal (has to be >0 & < 1).
Logical, if TRUE plots the dominant frequency against time. Default is TRUE
.
Label of the time axis.
Label of the frequency axis.
A numeric vector of length 2 for the frequency limit of
the spectrogram (in kHz), as in spectro
. Default is c(0, f/2000).
Additional arguments to be passed to the plotting function.
This is a modified version of seewave's dfreq
function that allows to track the frequency
contour of a dominant harmonic even when the highest amplitude jumps between harmonics. The arguments and default values of the
original dfreq
function have been kept unchanged to facilitate switching between the 2 functions.
trackfreqs
for tracking frequencies iteratively on selections tables.
# NOT RUN {
{
#Set temporary working directory
# setwd(tempdir())
#load data
# Check this folder
getwd()
#track both frequencies
}
# }
Run the code above in your browser using DataLab