lts | R Documentation |
A spectrogram computed over several survey files obtained with a Wildlife Acoustics SongMeter recorder
lts(dir, f, wl = 512,
wn = "hanning", ovlp = 0, rmoffset = TRUE, FUN = mean, col = spectro.colors(30),
fftw = FALSE, norm = FALSE, verbose = TRUE,
tlab = "Time", ntann = NULL, flab = "Frequency (kHz)",
recorder = c("songmeter", "audiomoth"), plot = TRUE, ...)
dir |
a character vector, the path to the directory where the .wav files are stored or directly the names of the .wav files to be processed. |
f |
sampling frequency of |
wl |
window length for the analysis (even number of points) (by default = 512). |
wn |
window name, see |
ovlp |
overlap between two successive windows (in %). |
rmoffset |
a logical to sepcify whether DC offset should be
removed. By default |
FUN |
the function to apply to compute the successive frequency spectra, by
default |
col |
a list of colors or the color palette with a number of colors |
fftw |
if |
norm |
a logical, to specify if each mean
spectrum should be normalised between 0 and 1 (default |
verbose |
a logical, if |
tlab |
label of the time axis. |
ntann |
a numeric of length 1, the number of axis annotations (all annotations by default). |
flab |
label of the frequency axis. |
recorder |
the type of automatic recorder used, either a Wildlife SongMeter or a Open Audio deveices Audiomoth. |
plot |
logical, if |
... |
other |
The function reads each .wav file and computes its mean spectrum with
meanspec
. The successive mean spectra are then
concatenated into a single image with the function
image
.
The parameters wl
, ovlp
, and wn
are those of the
function meanspec
.
This function returns a list of three items:
time |
a numeric vector corresponding to the time axis. |
freq |
a numeric vector corresponding to the frequency axis. |
amp |
a numeric or a complex matrix corresponding to the amplitude values.
Each column is a Fourier transform of length |
Jerome Sueur
spectro
, meanspec
,
image
,
spectro3D
, ggspectro
,
songmeter
, audiomoth
## Not run:
## if 'dir' contains a set of files recorded with a Wildlife Acoustics
# songmeter recorder then a direct way to obtain
# the spectrogram of all .wav files is
dir <- "pathway-to-directory-containing-wav-files"
lts(dir)
# to normalise each mean spectrum
lts(dir, norm=TRUE)
# to change the STFT parameters used to obtain each mean spectrum
lts(dir, wl=1024, wn="hamming", ovlp=50)
# to change the colors and the number of time labels and to make it quiet
lts(dir, col=cm.colors(20), ntann=10, verbose=FALSE)
## direct use of files names stored in the working directory
files <- c("S4A09154_20190213_150000.wav", "S4A09154_20190213_153000.wav",
"S4A09154_20190213_160000.wav", "S4A09154_20190213_163000.wav",
"S4A09154_20190213_170000.wav", "S4A09154_20190213_173000.wav",
"S4A09154_20190213_180000.wav", "S4A09154_20190213_183000.wav",
"S4A09154_20190213_190000.wav", "S4A09154_20190213_193000.wav")
lts(files)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.