cutspec {seewave} | R Documentation |
This function can be used to select (cut) a specific part of a frequency spectrum.
cutspec(spec, f = NULL, flim, norm = FALSE, PMF = FALSE)
spec |
a vector or a two-column matrix set resulting of a spectral analysis (not in dB)
This can be the value obtained with spec or meanspec . |
f |
sampling frequency of spec (in Hz). |
flim |
a vector of length 2 to specify the new frequency range (in kHz). |
norm |
a logical, if TRUE the spectrum returned is normalised between 0 and 1. |
PMF |
a logical, if TRUE the spectrum returned is a probability mass function. |
A new spectrum is returned.
The class of the returned object is the one of the input object (spec
)
The sampling frequency f
is not necessary if spec
has been obtained with
either spec
or meanspec
.
This function can be used before calling analysis function like sh
or
sfm
. See examples.
Jerome Sueur sueur@mnhn.fr
data(orni) a<-meanspec(orni,f=22050,plot=FALSE) b<-cutspec(a,flim=c(4,8)) # quick check with a plot plot(b,type="l") # effects on spectral entropy sfm(a) sfm(b)