komunikilo 0.1.5

A chaotic communications simulator.
Documentation
#!/usr/bin/env python3
from typing import Iterable, List

from cdma import tx_baseband_cdma


def tx_cdma_bpsk_1(
    bits: Iterable[bool],
    sample_rate: int,
    symbol_rate: int,
    freq: float,
    key: List[bool],
) -> List[float]:
    """Incorrect; Produces Just the Spreading Code, basically."""
    return tx_bpsk(
        tx_baseband_cdma(bits, key),
        sample_rate,
        symbol_rate * len(key),
        freq,
    )


def tx_cdma_bpsk_2(
    bits: Iterable[bool],
    sample_rate: int,
    symbol_rate: int,
    freq: float,
    key: List[bool],
) -> List[float]:
    """Incorrect: Transmits regular BPSK, but code-spreaded."""
    return tx_bpsk(
        tx_baseband_cdma(bits, key),
        sample_rate,
        symbol_rate,
        freq,
    )


def tx_cdma_bpsk_3(
    bits: Iterable[bool],
    sample_rate: int,
    symbol_rate: int,
    freq: float,
    key: List[bool],
) -> List[float]:
    """Incorrect: crazy high frequency."""
    return tx_bpsk(
        tx_baseband_cdma(bits, key),
        sample_rate,
        symbol_rate / len(key),
        freq,
    )