This function returns a kHz binned spectrum as described by Kasten et al. (2012) for the description of a soundscape.
soundscapespec(wave, f, channel = 1, wl = 1024, wn = "hamming", ovlp = 50,
plot = TRUE, xlab = "Frequency (kHz)", ylim = c(0, 1), ...)
A two-column numeric matrix, the first column returning the
frequency (kHz) bands and the second column returning the power
value within each frequency band.
A barplot is returned when plot
is TRUE
.
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).
length of the window for the analysis (even number of points, by default = 1024).
window name, see ftwindow
(by default "hamming"
).
overlap between two successive analysis windows (in %), by default = 50%.
if TRUE
returns a barplot.
title of the barplot x axis.
range of the barplot y axis.
other barplot
graphical parameters.
Jerome Sueur and Eric Kasten
The soundscape frequency spectrum is based on the computation of a spectrogram power spectral density using Welch'smethod (Welch & June, 1967). Parameters used in Kasten et al. (2012) were a Hamming window of 1024 samples with 50% of overlap and are used here as default values.
Kasten, E.P., Gage, S.H., Fox, J. & Joo, W. (2012). The remote
environmental assessment laboratory's acoustic library: an archive for
studying soundscape ecology. Ecological Informatics, 12, 50-67.
Welch, P.D., June (1967). The use of the fast Fourier transform for the estimation
of power spectra: a method based on time-averaging over short, modified
periodograms. IEEE Transactions on Audio and Electroacoustics, 15: 70-73.
spec
, meanspec
, SAX
, NDSI
## Note that 'tico' is not a soundscape recording...
data(tico)
soundscapespec(tico, plot=TRUE, col="darkgreen")
Run the code above in your browser using DataLab