normalize {tuneR}R Documentation

Rescale the range of values

Description

Centering and rescaling the waveform of a Wave object to either [-1,1], [0, 254], [-32767, 32767], [-8388607, 8388607], or [-2147483647, 2147483647].

Usage

normalize(object, unit = c("1", "8", "16", "24", "32", "0"), center = TRUE, level = 1)

Arguments

object Object of class Wave.
unit Unit to rescale to.
"1" (default) for rescaling to real values in [-1,1],
"8" (i.e. 8-bit) for rescaling to integers in [0, 254],
"16" (i.e. 16-bit) for rescaling to integers in [-32767, 32767],
24 (i.e. 24-bit) for rescaling to integers in [-8388607, 8388607],
32 (i.e. 32-bit) for rescaling to integers in [-2147483647, 2147483647], and
"0" for not rescaling (hence only centering, if center=TRUE).
center If TRUE (default), values are centered around 0 (or 127, if unit="8").
level Maximal percentage of the amplitude used for normalizing (default is 1).

Value

An object of class Wave.

Author(s)

Uwe Ligges, ligges@statistik.tu-dortmund.de, based on code from Matthias Heymann's former package ‘sound’.

See Also

Wave-class, Wave, writeWave


[Package tuneR version 0.2-10 Index]