Radio-Frequency Chain

Inheritance diagram of hermespy.simulation.rf.chain.RFChain
class RFChain(seed=None)[source]

Bases: RandomNode, Serializable

Representation of a block-base radio-frequency front-end.

Parameters:

seed (int | None) – Seed with which to initialize the radio-frequency chain’s random state.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

RFChain

Returns:

The deserialized object.

add_block(block)[source]

Add a new radio-frequency block to the chain.

The same block configuration can be added multiple times, each time creating a new BlockReference instance.

Parameters:

block (TypeVar(RFBT, bound= RFBlock)) – The radio-frequency block to add to the chain.

Return type:

RFBlockReference[TypeVar(RFBT, bound= RFBlock)]

Returns: A reference to the added block.

add_blocks(block, count)[source]

Add multiple identical blocks the radio-frequency chain.

Parameters:
  • block (TypeVar(RFBT, bound= RFBlock)) – Radio frequency block to add to the chain.

  • count (int) – Number of times to add the block.

Return type:

list[RFBlockReference[TypeVar(RFBT, bound= RFBlock)]]

Returns: List of references to the added blocks.

connect(port_a, port_b)[source]

Connect an output port of one block to an input port of another block.

Parameters:
Raises:

ValueError – If two ports of the same type are connected.

Return type:

None

new_block(block, **kwargs)[source]

Initialize a new radio-frequency block instance and add it to the chain.

Parameters:
  • block (type[TypeVar(RFBT, bound= RFBlock)]) – Type of the radio-frequency block to create.

  • kwargs – Additional keyword arguments to pass to the block’s constructor.

Return type:

RFBlockReference[TypeVar(RFBT, bound= RFBlock)]

Returns:

A reference to the newly initialized block instance.

new_blocks(block, count, **kwargs)[source]

Initialize multiple identical radio-frequency block instances and add them to the chain.

Parameters:
  • block (type[TypeVar(RFBT, bound= RFBlock)]) – Type of the radio-frequency block to create.

  • count (int) – Number of blocks to create.

  • kwargs – Additional keyword arguments to pass to the block’s constructor.

Return type:

list[RFBlockReference[TypeVar(RFBT, bound= RFBlock)]]

Returns: List of references to the newly created blocks.

realize(bandwidth, oversampling_factor, carrier_frequency)[source]

Realize the radio-frequency chain.

Parameters:
  • sampling_rate – Simulation bandwidth of the chain in Hz.

  • oversampling_factor (int) – Oversampling factor of the chain’s modeling.

  • carrier_frequency (float) – Target carrier frequency of the modeled radio-frequency chain in Hz.

Return type:

RFChainRealization

Returns: An instance of RFChainRealization representing the realized chain.

receive(rf_input, realization)[source]

Receive a signal through the radio-frequency chain.

Parameters:
Return type:

DenseSignal

Returns:

The output signal after propagation through the radio-frequency chain.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

transmit(dsp_output, realization)[source]

Transmit a signal through the radio-frequency chain.

Parameters:
Return type:

RFSignal

Returns:

The output signal after propagation through the radio-frequency chain.

property num_digital_input_ports: int[source]

Number of digital ports feeding into the radio-frequency chain.

property num_digital_output_ports: int[source]

Number of digital ports receiving output from the radio-frequency chain.

class RFChainRealization(bandwidth, oversampling_factor, carrier_frequency, block_states)[source]

Bases: object

Realization of a radio-frequency chain.

Parameters:
  • bandwidth (float) – Simulation bandwidth of the chain in Hz.

  • oversampling_factor (int) – Oversampling factor of the chain’s modeling.

  • carrier_frequency (float) – Target carrier frequency of the modeled radio-frequency chain in Hz.

  • block_states (dict[RFBlockReference, RFBlockRealization]) – Dictionary mapping block references to their states.

property bandwidth: float[source]

Simulation bandwidth of the chain in Hz.

property block_states: dict[RFBlockReference, RFBlockRealization][source]

List of realizations for each block in the radio-frequency chain.

property carrier_frequency: float[source]

Target carrier frequency of the modeled radio-frequency chain in Hz.

property oversampling_factor: int[source]

Oversampling factor of the chain’s modeling.

property sampling_rate: float[source]

Sampling rate of the chain in Hz.

class RFBlockReference(block)[source]

Bases: Generic[RFBT], Serializable

Reference to a radio-frequency block within a radio-frequency chain.

Parameters:

block (TypeVar(RFBT, bound= RFBlock)) – The radio-frequency block to reference.

classmethod Deserialize(process)[source]

Deserialize an object’s state.

Objects cannot be deserialized directly, instead a Factory must be instructed to carry out the deserialization process.

Parameters:

process (DeserializationProcess) – The current stage of the deserialization process. This object is generated by the Factory and provides an interface to deserialization methods supporting multiple backends.

Return type:

RFBlockReference

Returns:

The deserialized object.

connect_from(output, output_ports, input_ports)[source]

Connect this block to another block’s input ports.

Parameters:
  • output (RFBlockReference) – The output block to connect to.

  • output_ports (int | list[int]) – The output ports of this block to connect.

  • input_ports (int | list[int]) – The input ports of the output block to connect.

Return type:

None

connect_to(input, output_ports, input_ports)[source]

Connect this block’s output ports to another block’s input ports.

Parameters:
  • input (RFBlockReference) – The input block to connect to.

  • output_ports (int | list[int]) – The output ports of this block to connect.

  • input_ports (int | list[int]) – The input ports of the input block to connect.

Return type:

None

incoming_block_index(block)[source]

Get the index of the incoming block in the list of incoming connections.

Parameters:

block (RFBlockReference) – The radio-frequency block reference to find in the incoming connections.

Return type:

int

Returns: The index of the incoming block in the list of incoming connections.

port(name)[source]

Get a reference to a port or group of ports by name.

Parameters:

name (str) – Name of the port or group of ports to access. The name resolves to an attribute of the referenced of type RFBlockPort.

Return type:

RFBlockPortReference[TypeVar(RFBT, bound= RFBlock)]

Returns:

A reference to the requested port or group of ports.

Raises:

AttributeError – If the requested port or group of ports does not exist.

propagate(state, input)[source]

Propagate a signal through the referenced block.

Parameters:
  • state (RFBlockRealization) – The state of the referenced block.

  • input (RFSignal) – The input signal to propagate through the block.

Return type:

RFSignal

Returns: The output signal after propagation through the block.

serialize(process)[source]

Serialize this object’s state.

Objects cannot be serialized directly, instead a Factory must be instructed to carry out the serialization process.

Parameters:

process (SerializationProcess) – The current stage of the serialization process. This object is generated by the Factory and provides an interface to serialization methods supporting multiple backends.

Return type:

None

property block: RFBT[source]

The referenced radio-frequency block.

property incoming_connections: OrderedDict[RFBlockReference, tuple[list[int], list[int]]][source]

Dictionary of blocks connected to this block’s input ports.

The map’s keys are references to connected blocks. The map’s values are tuples containing: * A list of outgoing port indices from the connected block. * A list of incoming port indices to this block.

property num_connected_input_ports: int[source]

Number of connected input ports.

property num_connected_output_ports: int[source]

Number of connected output ports.

property open_input_ports: list[int][source]

List of open input port indices.

property outgoing_connections: OrderedDict[RFBlockReference, tuple[list[int], list[int]]][source]

Dictionary of blocks connected to this block’s output ports.

The map’s keys are references to connected blocks. The map’s values are tuples containing: * A list of outgoing port indices from this block. * A list of incoming port indices to the connected block.

class RFBlockPortReference(block_reference, port_indices, port_type)[source]

Bases: Generic[RFBT], RFBlockPort[RFBT]

Reference to a port or a group of ports of a radio-frequency block.

Parameters:
property block_reference: RFBlockReference[RFBT][source]

Reference to the radio-frequency block this port belongs to.