This function estimates the fundamental frequency through a short-term cepstral transform.
fund(wave, f, channel = 1, wl = 512, ovlp = 0, fmax = f/2, threshold = NULL,
at = NULL, from = NULL, to = NULL,
plot = TRUE, xlab = "Time (s)", ylab = "Frequency (kHz)",
ylim = c(0, f/2000), pb = FALSE, ...)
When plot
is FALSE
, fund
returns a two-column matrix, the first column corresponding to time in seconds (x-axis) and the second column corresponding to
to fundamental frequency in kHz (y-axis).
NA corresponds to pause sections in wave
(see
threshold
).
No plot is produced when using at
.
an R object.
sampling frequency of wave
(in Hz). Does not need to
be specified if embedded in wave
.
channel of the R object, by default left channel (1).
if at
is not null, length of the window for the analysis
(even number of points, by defaults = 512).
overlap between two successive windows (in %).
the maximum frequency to detect (in Hz).
amplitude threshold for signal detection (in %).
position where the estimate the fundamental frequency (in s)
.
start position where to compute the fundamental frequency (in s).
end position to compute the fundamental frequency (in s).
logical, if TRUE
plots the fundamental frequency
modulations against time (by default TRUE
).
title of the time axis (s).
title of the frequency axis (Hz).
the range of frequency values.
if TRUE
returns a text progress bar in the console.
other plot
graphical parameters.
Jerome Sueur sueur@mnhn.fr.
Oppenheim, A.V. and Schafer, R.W. 2004. From frequency to quefrency: a history of the cepstrum. Signal Processing Magazine IEEE, 21: 95-106.
cepstro
, ceps
, autoc
data(sheep)
# estimate the fundamental frequency at a single position
fund(sheep, f=8000, fmax=300, at=1, plot=FALSE)
# track the fundamental frequency along time
fund(sheep,f=8000,fmax=300,type="l")
# with 50% overlap between successive sliding windows, time zoom and
# amplitude filter (threshold)
fund(sheep,f=8000,fmax=300,type="b",ovlp=50,threshold=5,ylim=c(0,1),cex=0.5)
# overlaid on a spectrogram
spectro(sheep,f=8000,ovlp=75,zp=16,scale=FALSE,palette=reverse.gray.colors.2)
par(new=TRUE)
fund(sheep,f=8000,fmax=300,type="p",pch=24,ann=FALSE,
xaxs="i",yaxs="i",col="black",bg="red",threshold=6)
Run the code above in your browser using DataLab