setenv(wave1, wave2, f, envt="hil", msmooth = NULL, ksmooth = NULL,
plot = FALSE, listen = FALSE, output = "matrix", ...)
wave
(in Hz). Does not need to be specified if embedded in wave
.wave2
: either "abs" for absolute
amplitude envelope or "hil" for Hilbert amplitude envelope. See env
.wave2
with a mean sliding window. The first component is the window length
(in number of points). The second component is the overlap between
successive windows (in %). SeeTRUE
returns the oscillogram
of the new time wave (by default FALSE
).TRUE
the new sound is played back."matrix"
, "Wave"
, "Sample"
, "audioSample"
or "ts"
.oscillo
graphical parameters.plot
is FALSE
, a new wave is returned. The class
of the returned object is set with the argument output
.wave1
and wave2
can have different duration (length)
Smoothing the envelope with smooth
or ksmooth
can significantly
change the value returned.drawenv
, env
, synth
data(tico)
a<-synth(d=1,f=22050,cf=1000)
# apply 'tico' ammplitude envelope to 'a' that has a square amplitude envelope
setenv(a,tico,f=22050,plot=TRUE)
# the same but with smoothing the envelope
setenv(a,tico,f=22050,ksmooth=kernel("daniell",50),plot=TRUE)
Run the code above in your browser using DataLab