cutSampleEnds(sound)
cutSampleEnds()所属R语言包:sound
Prepare Sample Object for appendSample
准备示例对象appendSample
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Prepare a Sample object or a wav file for usage of appendSample to avoid cracks between two appended samples.
准备一个Sample对象或WAV文件使用的appendSample,以避免两个附加样本之间的裂缝。
用法----------Usage----------
参数----------Arguments----------
参数:s
a Sample object, or a string giving the name of a wav file.
样品对象,或者一个字符串,给出一个wav文件的名称。
Details
详细信息----------Details----------
At the beginning of the sample, all values in the waveform until the first transition from negative to positive values are dropped, at the end everything after the last transition from negative to positive values is dropped.
的样本开始,从负到正的值,直到第一个过渡的波形中的所有值都将被丢弃,在最后结束时,一切都转变,从消极到积极的价值观被丢弃。
Currently, only channel 1 is used to determine which parts to drop. Hence in stereo samples there can still be some cracks in the right channel.
目前,只有信道1是用来确定哪些部分下降。因此,立体声样品仍然可以有一些在右声道的破解。
值----------Value----------
a Sample object.
Sample对象。
(作者)----------Author(s)----------
Matthias Heymann
参见----------See Also----------
cutSample, appendSample
cutSample,appendSample
实例----------Examples----------
s1 <- Sine(440,.01)
s2 <- Sine(550,.01)
s3 <- Sine(660,.01)
s4 <- Sine(880,.01)
l <- list(s1,s2,s3,s4)
# first without cutSampleEnds:[第一次没有cutSampleEnds:]
s <- nullSample()
for (i in 1:99) {
s <- appendSample(s,l[[i%%4+1]])
}
play(s) # ugly cracks[难看的裂缝]
# now with cutSampleEnds:[现在与cutSampleEnds:]
s <- nullSample()
for (i in 1:99) {
s <- appendSample(s,cutSampleEnds(l[[i%%4+1]]))
}
play(s) # no cracks,[无裂纹,]
# This is how it works:[这是如何工作的:]
# The waveform is not smooth between s1 and s2:[s1和s2之间的波形是不光滑:]
plot(appendSample(s1,s2))
# This is because s1 just ends somewhere at y=0.6:[这是因为s1刚刚结束的地方,在y = 0.6:]
plot(s1)
# Let's cut off the last positive part of it:[让切断的最后一个积极的组成部分:]
plot(cutSampleEnds(s1))
# A similar cuttoff would be made at the beginning[在开始进行类似的cuttoff]
# of the sample (if it was necessary).[的样品(如果有必要)。]
# Now the two samples fit perfectly (the cut is at x=400):[现在,两个样本伏贴(剪切是在x = 400):]
plot(appendSample(cutSampleEnds(s1),cutSampleEnds(s2)))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|