imtoolkit.SemiUnitaryDifferentialMLDSimulator module

class imtoolkit.SemiUnitaryDifferentialMLDSimulator.SemiUnitaryDifferentialMLDSimulator(codes, channel)[source]

Bases: imtoolkit.Simulator.Simulator

A simulator that relies on the non-coherent maximum likelihood detector, where semi-unitary matrices are used for differential encoding and decdoing. The semi-unitary matrix is defined by $U U^H = lpha I_M$ and $lpha in mathbb{R}$. The environment variable USECUPY determines whether to use cupy or not.

simulateBERParallel(params, outputFile=True, printValue=True)[source]

Simulates BER values at multiple SNRs, where the massively parallel algorithm is used. This implementation is especially designed for cupy.

Parameters
  • params (imtoolkit.Parameter) – simulation parameters.

  • outputFile (bool) – a flag that determines whether to output the obtained results to the results/ directory.

  • printValue (bool) – a flag that determines whether to print the simulated values.

Returns

a dict that has two keys: snr_dB and ber, and contains the corresponding results. All the results are transferred into the CPU memory.

Return type

ret (dict)

simulateBERReference(params, outputFile=True, printValue=True)[source]

Simulates BER values at multiple SNRs, where the straightforward reference algorithm is used. Note that this time complexity is unrealistically high.

Parameters
  • params (imtoolkit.Parameter) – simulation parameters.

  • outputFile (bool) – a flag that determines whether to output the obtained results to the results/ directory.

  • printValue (bool) – a flag that determines whether to print the simulated values.

Returns

a dict that has two keys: snr_dB and ber, and contains the corresponding results. All the results are transferred into the CPU memory.

Return type

ret (dict)