covspectro(wave1, wave2, f, wl = 512, wn = "hanning", n, plot = TRUE, plotval = TRUE,
method = "spearman", col = "black", colval = "red", cexval = 1,
fontval = 1, xlab = "Time (s)",
ylab = "Normalised covariance (cov)", type = "l", ...)
Sample
object generated loading a wav file
with loadSample
(package Sample
object generated loading a wav file
with loadSample
(package wave1
and wave1
(in Hz).
Does not need to be specified if wave1
and/or wave2
are/is (a)
Sample
object(s).ftwindow
(by default "hanning"
).wave1
and wave2
when sliding wave2
along wave1
.TRUE
plots r values against frequency shift
(by default TRUE
).TRUE
adds to the plot maximum R value
and frequency offset (by default TRUE
).cor
).plot
is TRUE
, type of plot that should be drawn.
See plot
for details (by default "l" for lines).plot
graphical parameters.plot
is FALSE
, covspectro
returns a list containing
three components:wave1
and wave2
.wave1
and wave2
.cov
.wave1
and
the spectrogram of wave2
are computed when regularly sliding
forward and backward wave2
along wave1
.
The maximal covariance is obtained at a particular shift (time offset).
This shift may be positive or negative.
n
sets in how many steps wave2
will be slided along wave1
.
Time process can be then decreased by setting low n
value.
Inverting wave1
and wave2
may give slight different results.corspec
, corenv
, spectro
,
cor
,# covariance between two echemes of a cicada calling song
data(orni)
orni1<-cutw(orni,f=22050,from=0,to=0.1,plot=FALSE)
orni2<-cutw(orni,f=22050,from=0.15,to=0.25,plot=FALSE)
covspectro(orni1,orni2,f=22050,n=37)
Run the code above in your browser using DataLab