specprop {seewave} | R Documentation |
This function returns a list of statistical properties of a frequency spectrum.
specprop(spec, f, str = FALSE, plot = FALSE, type = "l", ...)
spec |
a data set resulting of a spectral analysis obtained
with spec or meanspec (not in dB). |
f |
sampling frequency of wave (in Hz). |
str |
logical, if TRUE returns the results in a structured table. |
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. |
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
.
A list of 15 values is returned
mean |
mean frequency (see mean ) |
sd |
standard deviation of the mean (see sd ) |
sem |
standard error of the mean |
median |
median frequency (see median ) |
mad |
absolute deviation of median (see mad ) |
mode |
mode frequency, i.e. the dominant frequency |
Q25 |
first quartile (see quantile ) |
Q75 |
third quartile (see quantile ) |
IQR |
interquartile range (see IQR ) |
cent |
centro�d, see note |
skewness |
skewness, a measure of asymmetry, see note |
kurtosis |
kurtosis, a measure of peakedness, see note |
sfm |
spectral flatness measure (see sfm ) |
sh |
spectral entropy (see sh ) |
prec |
frequency precision of the spectrum |
Centroid is computed according to:
C = sum(x*y)
with:
x = frequencies,
y = relative amplitude of the i frequency,
N = number of frequencies.
Skewness is computed according to:
S = sum((x-mean(x))^3)/(N-1)/sd^3
.
S < 0 when the spectrum is skewed to left,
S = 0 when the spectrum is symetric,
S > 0 when the spectrum is skewed to right.
Spectrum asymmetry increases with |S|.
Kurtosis is computed according to:
K = sum((x-mean(x))^4)/(N-1)/sd^4
.
K < 3 when the spectrum is platikurtic, i.e. it has fewer items at the
center and at the tails than the normal curve but has more items in the shoulders,
K = 3 when the spectrum shows a normal shape,
K > 3 when the spectrum is leptokurtic, i.e. it has more items near
the center and at the tails, with fewer items in the shoulders
relative to normal distribution with the same mean and variance.
Jerome Sueur sueur@mnhn.fr and Caroline Simonis csimonis@mnhn.fr.
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) # plots specprop(a,f=22050,plot=1) specprop(a,f=22050,plot=2)