Skip to contents

Adding noise to a Wave like object allows for testing of the robustness of automated identification algorithms to noise.

Usage

generateNoise(
  wave,
  noise = c("white"),
  noise.add = TRUE,
  noise.ratio = 0.5,
  noise.ref = "file",
  output = "list"
)

Arguments

wave

Object to add noise to (Wave, WaveMC, or Tagged versions), or a list of such objects.

noise

Vector of noise to add (unif, gaussian, white, pink, power, red)

noise.add

If TRUE, the default, the noise sources are summed and the sum added to the wave. If FALSE each source is added to the wave on its own, and a list of waves is returned, one for each source.

noise.ratio

Ratio of maximum noise amplitude to the maximum amplitude in wave.

noise.ref

Reference maximum for noise.ratio. If "max" then the maximum amplitude, if "file" then the maximum amplitude of wave.

output

TODO: Is this implemented?

Value

The wave with the noise added, or a list of waves: one for each noise source where noise.add is FALSE and there is more than one, and one for each wave where a list of waves is given.

Details

The noise added to each channel is generated separately, so the channels of a multi-channel wave hold independent noise. One sequence used to be added to every channel, which left the noise perfectly correlated between them and so cancelling exactly in any difference between the channels: tdoa(), bearing() and corWaveMC() all read inter-channel differences, and noise identical in every channel tests none of them.

Applied to a TaggedWave or TaggedWaveMC the call is recorded in the processing slot of the result, as described in tagApply().