dbnorm: Function to dB-normalise spectral objects

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
dbnorm(specdata, f = 0, db = 0)

Arguments

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

Value

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.

Author(s)

Jonathan Harrington

See Also

dbtopower plot.spectral

Examples

1
2
3
4
5
6
7
# 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)

emuR documentation built on June 11, 2021, 5:10 p.m.