imtoolkit.CoherentMLDSimulator module

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

Bases: imtoolkit.Simulator.Simulator

A simulator that relies on the coherent maximum likelihood detector, that assumes perfect channel state information at the receiver. The environment variable USECUPY determines whether to use cupy or not.

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

Simulates AMI 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 ami, and contains the corresponding results. All the results are transferred into the CPU memory.

Return type

dict

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

Simulates AMI 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 ami, and contains the corresponding results. All the results are transferred into the CPU memory.

Return type

dict

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

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

dict