Bit Sources¶
Bit sources represent, as the title suggest, a source of (hard) communication bits
to be transmitted over a modem.
They are one of the default configuration parameters of a TransmittingModem
.
Every bit source implementation is expected to inherit from the BitsSource
base class,
which in turn represents a random node.
There are currently two basic types of bit sources available:
RandomBitsSource
instances implement a random stream of bitsStreamBitsSource
instances implement a deterministic stream of bits
- class BitsSource(seed=None)[source]¶
Bases:
ABC
,RandomNode
Base Class for Arbitrary Streams of Communication Bits.
Inheriting classes are required to implement the
generate_bits()
routine.- Parameters:
seed (int, optional) – Seed used to initialize the pseudo-random number generator.
- class RandomBitsSource(seed=None)[source]¶
Bases:
BitsSource
,Serializable
Bit stream generator for pseudo-random sequences of bits.
- Parameters:
seed (int, optional) – Seed used to initialize the pseudo-random number generator.
- class StreamBitsSource(path)[source]¶
Bases:
BitsSource
,Serializable
Bit-stream generator mapping representing file system streams as bit sources.
- Parameters:
path (str) – Path to the stream bits source.