Learn R Programming

seewave (version 1.5.5)

specprop: Spectral properties

Description

This function returns a list of statistical properties of a frequency spectrum.

Usage

specprop(spec, f, str = FALSE, flim=NULL, plot = FALSE, type = "l", ...)

Arguments

spec
a data set resulting of a spectral analysis obtained with spec or meanspec (not in dB).
f
sampling frequency of spec (in Hz).
str
logical, if TRUE returns the results in a structured table.
flim
a vector of length 2 to specifgy the frequency limits of the analysis (in kHz)
plot
if 1 returns the spectrum , if 2 returns the cumulative spectrum, both of them with the first quartile, the third quartile, the median and the mode plotted (by default FALSE).
type
if plot is TRUE, type of plot that should be drawn. See plot for details (by default "l" for lines).
...
other plot graphical parameters.

Value

  • A list of 15 values is returned
  • meanmean frequency (see mean)
  • sdstandard deviation of the mean (see sd)
  • semstandard error of the mean
  • medianmedian frequency (see median)
  • madabsolute deviation of median (see mad)
  • modemode frequency, i.e. the dominant frequency
  • Q25first quartile (see quantile)
  • Q75third quartile (see quantile)
  • IQRinterquartile range (see IQR)
  • centcentro�d, see note
  • skewnessskewness, a measure of asymmetry, see note
  • kurtosiskurtosis, a measure of peakedness, see note
  • sfmspectral flatness measure (see sfm)
  • shspectral entropy (see sh)
  • precfrequency precision of the spectrum

Details

The spectrum is converted in a probability mass function (PMF). If a selected value has to be selected with $, the argument str has to be set to FALSE.

Examples

Run this code
data(orni)
a<-meanspec(orni,f=22050,plot=FALSE)
specprop(a,f=22050)
# to get a single measure of the list
specprop(a,f=22050)$mode
# to get the results structured
specprop(a,f=22050,str=TRUE)
# to limit the analysis between 4 and 6 kHz
specprop(a,f=22050,flim=c(4,6),str=TRUE)
# plots
specprop(a,f=22050,plot=1)
specprop(a,f=22050,plot=2)

Run the code above in your browser using DataLab