bits range by taking the integer part of its product by 128. The problem is

that, when the resulting integer number is represented in two's complement, the

number +1.0 is not representable since, on 8 bits, the largest positive number

that can be represented is 127. Due to the circularity of two's complement

representation, the multiplication 1.0 × 128 produces the number -128, which

is also the representation of -1.0. Therefore, the audio device sees a constant

sequence of numbers equal to the most negative representable number, and it

does not produce any sound, except for the transients due to the initial and final

steps. Once the problem had been discovered and understood, the user could

circumvent it by rescaling the signal in a slightly larger range, e.g., [-1, 1.1].

e wavwrite(). The former couple of functions work with files in au format, while

the latter couple work with files in the popular wav format. In earlier version

of Malab (before version 5) these functions only dealt with 8-bit files, thus pre-

cluding high-quality audio processing. For users of old Matlab versions, two

routines are available for reading and writing 16-bit wav files, called wavr16.m

and wavw16.m, written by F. Caron and modified to ensure Octave compatibil-

ity. An example of usage for wavr16() is

phonic. The returned vector format has four components containing format

information: the kind of encoding (indeed only PCM linear is recognized), the

number of channels, the sample rate, and the number of quantization bits.

in a monophonic or stereophonic file.

sample processing is quite inefficient with interpreters such as Octave or Matlab,

that are optimized to handle matrices. As an example of elementary processing,

consider a simple smoothing operation, obtained by substitution of each input

sound sample with the average between itself and the following sample. Here is

a script that does this operation in Octave, after having loaded a monophonic

sound file:

S = (L + [L(2:length(L)); 0]) / 2; %``smoothed'' sound

with its echo delayed by 200ms.