Skip to contents

Internal "work function" used to implement the exported function denoise_chunks().

Usage

denoise_diffs(
  x,
  x.diff,
  absolute.threshold = 0,
  relative.threshold = 0.05,
  range.baseline = 0
)

Arguments

x

numeric vector Supplying the range of data before computing differences, or the data themselves.

x.diff

numeric vector The running differences to be de noised.

absolute.threshold

numeric The largest difference values to ignore, i.e., to set to zero. Expressed as a change per second.

relative.threshold

numeric The multiplier to apply to the spread of x to obtain the largest difference values to ignore, i.e., to set to zero. Expressed as a change per second.

range.baseline

numeric An additional value included in the computation of the range of the observations. Set range.baseline = NA for the spread applied to relative.threshold to be computed only based on the observations, set range.baseline = 0 for the range to include zero, i.e., use a relative threshold relative to the maximum observation.

Value

denoise_diffs() returns a data.frame that is a modified copy of data with each column of differences named in qty.name, if present, with differences smaller than the computed minimum difference size threshold replaced by zeros.

See also