Function to dB-normalise spectral objects
The function can be used to rescale a spectrum to a dB value at a particular frequency - for example, to rescale the spectrum so that 3000 Hz has 0 dB and all other values are shifted in relation to this.
dbnorm(specdata, f = 0, db = 0)
specdata |
An object of class 'spectral' |
f |
A single element vector specifying the frequency. Defaults to 0 |
db |
A single element vector specifying the dB value to which the spectrum is to be rescaled. Defaults to zero |
An object of the same class with rescaled dB values. The default is to rescale the dB-values of the spectrum to 0 dB at 0 Hz.
Jonathan Harrington
# normalise to - 40 dB at 1500 Hz res = dbnorm(e.dft, 1500, 0) # compare the two ylim = range(c(res, e.dft)) plot(e.dft, ylim=ylim, type="l") par(new=TRUE) plot(res, ylim=ylim, type="l", col=2)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.