Last chance! 50% off unlimited learning
Sale ends in
simspec(spec1, spec2, f, plot = FALSE, type = "l", lty1 = 1, lty2 = 2,
lty3 = 3, col1 = 2, col2 = 4, col3 = 1, flab = "Frequency (kHz)",
alab = "Amplitude (percentage)", flim = c(0, f/2000), alim = c(0, 100), ...)
spec1
and spec2
(in Hz).TRUE
plots both spectra and similarity function
(by default FALSE
).plot
is TRUE
, type of plot that should be drawn.
See plot
for details (by default "l" for lines).spec1
if type
="l".spec2
if type
="l".type
="l".spec1
.spec2
.plot
graphical parameters.plot
is TRUE
, both spectra and the similarity function are
plotted on the same graph. The index is the mean of this function.spec
, meanspec
, corspec
,
diffspec
, diffenv
a<-noise(f=8000,d=1)
b<-synth(f=8000,d=1,cf=2000)
c<-synth(f=8000,d=1,cf=1000)
d<-noise(f=8000,d=1)
speca<-spec(a,f=8000,wl=512,at=0.5,plot=FALSE)
specb<-spec(b,f=8000,wl=512,at=0.5,plot=FALSE)
specc<-spec(c,f=8000,wl=512,at=0.5,plot=FALSE)
specd<-spec(d,f=8000,wl=512,at=0.5,plot=FALSE)
simspec(speca,speca,f=8000)
#[1] 100 => similar spectra of course!
simspec(speca,specb,f=8000)
#[1] 0.3873278
simspec(speca,specc,f=8000,plot=TRUE)
#[1] 0.5920857
# two pure tone at different frequency are...
simspec(specb,specc,f=8000,plot=TRUE)
#[1] 12.05652
#... less similar than two noises
simspec(speca,specd,f=8000,plot=TRUE)
#[1] 57.40742
Run the code above in your browser using DataLab