fbands(seewave)
fbands()所属R语言包:seewave
Frequency bands plot
频段图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This graphical function returns a frequency spectrum as a
此图形函数返回一个频谱为
用法----------Usage----------
参数----------Arguments----------
参数:spec
a data set resulting of a spectral analysis obtained with spec or meanspec. Can be in dB.
数据集的频谱分析获得spec或meanspec。可以以dB为单位。
参数:f
sampling frequency of spec (in Hz). Not requested if the first column of spec contains the frequency axis.
spec(赫兹)的采样频率。如果没有请求的第一列spec包含在频率轴上。
参数:bands
a numeric vector. If vector of length 1, then sets the number of bands dividing in equal parts the spectrum. If of length > 1, then takes the values as kHz limits of the bands dividing the spectrum. These bands can be of different size. See details and examples.
一个数值向量。如果矢量的长度为1,然后设置的频带的数目除以在相等的部分频谱。如果长度> 1,则需要作为千赫除以频谱的频带限制的值。这些条带可以是不同的大小。细节和例子。
参数:width
logical, if TRUE and that bands is an irregular series of values, then the width of the bands will be proportional to the frequency limits defined in bands.
逻辑,如果TRUE和bands是一个不规则的一系列值,然后将条带的宽度与频率成比例限制中定义的bands。
参数:plot
logical, if TRUE, a plot showing the peaks is returned.
逻辑,如果TRUE,峰图,则返回一个图。
参数:xlab
label of the x-axis.
的x-轴的标签。
参数:ylab
label of the y-axis.
标签的y轴。
参数:...
other plot graphical parameters.
其他plot图形参数。
Details
详细信息----------Details----------
The function proceeds as follows
的函数所得款项如下
divides the spectrum in bands. The limits of the bands are set with the argument bands. There are two options:
将频谱的频带。限制的频段设置参数bands。有两种选择:
you set a number of bands with equal size by giving a single value to bands. For instance, setting bands to a value of 10 will slice the spectrum in 10 equal parts and return 10 local peaks.
需要设置一些大小相同的带,给人一种单值bands。比如,设置bands的值10,将切片在10个相等的部分的频谱,并返回10局部峰值。
you set the limits of the bands. This is achieve by giving a numeric vector to bands. The limits can follow a regular or irregular series. For instance attributing the vector c(0,2,4,8) will generate the following bands [0,2[, [2,4[, [4,8] kHz. Be aware that the last value should not exceed half the sampling frequency used to obtain the spectrum spec.
设置的频带的限制。这是一个数值向量bands实现。的限制,可以按照定期或不定期的系列。例如归因于向量c(0,2,4,8),将产生以下范围[0,2,[2,4,[4,8]千赫。请注意最后的值不应该超过采样频率的一半获得的频谱spec的。
uses the function barplot.
采用的功能barplot。
值----------Value----------
A two-column matrix, the first column corresponding to the
两列的矩阵中,第一列对应于所述
注意----------Note----------
The value below bars is the mean between the corresponding frequency limits.
条形值低于平均值之间的对应频率的限制。
(作者)----------Author(s)----------
Jerome Sueur
参见----------See Also----------
meanspec, spec, barplot.
meanspec,spec,barplot。
实例----------Examples----------
data(sheep)
spec <- meanspec(sheep, f=8000, plot=FALSE)
# default plot[默认情况下图]
fbands(spec)
# setting a specific number of bands[设置一个特定的频带数]
fbands(spec, bands=6)
#setting specific regular bands limits[设定具体的定期带限制]
fbands(spec, bands=seq(0,4,by=0.25))
# some plot tuning[一些图调整]
op <- par(las=1)
fbands(spec, bands=seq(0,4,by=0.1),
horiz=TRUE, col=heat.colors(41),
xlab="", ylab="",
cex.axis=0.75, cex.names = 0.75,
axes=FALSE)
par(op)
# showing or not the width of the bands[显示或不频带宽度]
oct <- octaves(440,3)/1000
op <- par(mfrow=c(2,1))
fbands(spec, bands=oct, col="blue")
fbands(spec, bands=oct, width = TRUE, col="red")
par(op)
# kind of horizontal zoom[样的水平缩放]
op <- par(mfrow=c(2,1))
fbands(spec, bands=seq(0,4,by=0.2), col=c(rep(1,10),
rep("orange",5),rep(1,5)), main="all frequency range")
fbands(spec, bands=seq(2,3,by=0.2),
col="orange", main="a subset or zoom in")
par(op)
# kind of dynamic frequency bands[种动态频段]
specs <- dynspec(sheep, f=8000, plot= FALSE)$amp
out <- apply(specs, f=8000, MARGIN=2, FUN = fbands, bands = seq(0,4,by=0.2), col = 1, ylim=c(0,max(specs)))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|