| dfreq {seewave} | R Documentation |
This function gives the dominant frequency (i. e. the frequency of highest amplitude) of a time wave.
dfreq(wave, f, wl = 512, wn = "hanning", ovlp = 0, threshold = FALSE, plot = TRUE, xlab = "Times (s)", ylab = "Frequency (kHz)", ylim = c(0, f/2000), ...)
wave |
data describing a time wave
or a Sample object created loading a wav file
with loadSample (package Sound). |
f |
sampling frequency of wave (in Hz). |
wl |
length of the window for the analysis (even number of points). |
wn |
window name, see ftwindow (by default "hanning"). |
ovlp |
overlap between two successive analysis windows (in % ). |
threshold |
amplitude threshold for signal detection (in % ). |
plot |
logical, if TRUE plots the dominant frequency against time
(by default TRUE). |
xlab |
title of the x axis. |
ylab |
title of the y axis. |
ylim |
the range of y values. |
... |
other plot graphical parameters. |
If plot is FALSE, dfreq function returns a vector of
numeric data corresponding to the dominant frequency along the time wave.
This function is based on fft.
Jérôme Sueur jerome.sueur@univ-tours.fr
data(tico)
dfreq(tico,f=22050,wl=512,ovlp=50,threshold=5)
# overlay on spectrogram
spectro(tico,f=22050,wl=512,ovlp=50,zp=16,scale=FALSE,
collevels=seq(-40,0,1),palette=rev.terrain.colors)
par(new=TRUE,las=1)
dfreq(tico,f=22050,wl=512,ovlp=50,threshold=6,type="l",col="red",lwd=2,
ann=FALSE,xaxs="i",yaxs="i")