\"  mmux.roff from ObjectProDSP 0.1
\"  Copyright (C) 1994, Mountain Math Software, All rights reserved.
\"  Licensed for free use and distribution under version 2 of the Gnu General
\"  Public License. Please see file COPYING for details and restrictions.
\"  
\"  ObjectProDSP is a trademark of Mountain Math Software.
\"  
.H 1 "Multiplexing, bit manipulation and related operations"

Routines `Mux', `Demux', `MaskWord', `PackWord', `UnpackWord',
`RepackStream' and `GainPad' perform multiplexing bit
manipulation and
related operations. They are under `objects' and `dsp processing'.

`Mux' and `Demux' do multiplexing and demultiplexing. `Mux' combines
an arbitrary number of input channels into a single output channel.
`Demux' does the inverse operation. `Demux' can also separate
the real and imaginary components of a single data stream
into different output channels. `Demux' can invert this operation.

`GainPad' converts an real data stream to complex by padding the imaginary
part with 0. It can also apply a gain to the input.

`MaskWord' reads and writes a binary data stream applying a bit
mask to each input sample. Use `ToInteger' and `ToMach' to convert
input and output streams if needed.

`UnpackWord' unpacks a specified number of words of a specified
number of bits from a single physical integer input word 
and writes each of these as a separate sample to an
integer output data stream. `PackWord' does the inverse operation.
Both treat the least significant bits in a word as being first in
sequence.

`RepackStream' is a more general (and less efficient) operation than
`PackWord' and `UnpackWord'. It is its own inverse.
It treats its input and output channels
as continuous streams of bits with the least significant bits
in a physical word occurring
first in the continuous sequence.
It repacks the input stream with a specified
input word size to an output stream with a
specified output word size. These word sizes must be less than
or equal the physical word size in the stream.


