sh {seewave} | R Documentation |
Compute the entropy (H) of a spectrum.
sh(spec)
spec |
a data set resulting of a spectral analysis obtained
with spec or meanspec (not in dB). |
Spectral entropy is calculated according to:
S = -sum(ylogy)/log(N)
with:
y = relative amplitude of the i frequency,
and
sum(y) = 1
and N = number of frequencies.
Spectral entropy is returned.
The spectral entropy of a noisy signal will tend towards 1 whereas the spectral entropy of a pure tone signal will tend towards 0.
Jérôme Sueur jerome.sueur@univ-tours.fr
Nunes, R. R., Almeida de, M. P. & Sleigh, J. W. 2004 Spectral entropy: a new method for anesthetic adequacy. Revista Brasileira de Anestesiologia, 54, 413-422.
a<-synth(f=8000,d=1,cf=2000,plot=FALSE) speca<-spec(a,f=8000,wl=512,at=0.5,plot=FALSE) sh(speca) # [1] 0.2336412 b<-noise(d=1,f=8000) specb<-spec(b,f=8000,wl=512,at=0.5,plot=FALSE) sh(specb) # [1] 0.9740975