<jupyter_start><jupyter_text>“Hello, world!” Import Sionna:<jupyter_code># Import Sionna
try:
    import sionna
except ImportError as e:
    # Install Sionna if package is not already installed
    import os
    os.system("pip install sionna")
    import sionna
    
# IPython "magic function" for inline plots
%matplotlib inline
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Let us first create a [BinarySource](https://nvlabs.github.io/sionna/api/utils.html?highlight=binarysourcebinarysource) to generate a random batch of bit vectors that we can map to constellation symbols:<jupyter_code>batch_size = 1000 # Number of symbols we want to generate
num_bits_per_symbol = 4 # 16-QAM has four bits per symbol
binary_source = sionna.utils.BinarySource()
b = binary_source([batch_size, num_bits_per_symbol])
b<jupyter_output><empty_output><jupyter_text>Next, let us create a [Constellation](https://nvlabs.github.io/sionna/api/mapping.htmlsionna.mapping.Constellation) and visualize it:<jupyter_code>constellation = sionna.mapping.Constellation("qam", num_bits_per_symbol)
constellation.show();<jupyter_output><empty_output><jupyter_text>We now need a [Mapper](https://nvlabs.github.io/sionna/api/mapping.htmlmapper) that maps each row of b to the constellation symbols according to the bit labeling shown above.<jupyter_code>mapper = sionna.mapping.Mapper(constellation=constellation)
x = mapper(b)
x[:10]<jupyter_output><empty_output><jupyter_text>Let us now make things a bit more interesting a send our symbols over and [AWGN channel](https://nvlabs.github.io/sionna/api/channel.htmlsionna.channel.AWGN):<jupyter_code>awgn = sionna.channel.AWGN()
ebno_db = 15 # Desired Eb/No in dB
no = sionna.utils.ebnodb2no(ebno_db, num_bits_per_symbol, coderate=1)
y = awgn([x, no])

# Visualize the received signal
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure(figsize=(7,7))
ax = fig.add_subplot(111)
plt.scatter(np.real(y), np.imag(y));
ax.set_aspect("equal", adjustable="box")
plt.xlabel("Real Part")
plt.ylabel("Imaginary Part")
plt.grid(True, which="both", axis="both")
plt.title("Received Symbols");<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11345888837850253, 'fraction_numerical': 0.008268259072117593, 'mean_word_length': 6.615384615384615, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '529425', 'license': 'Apache-2.0', 'n_tokens_mistral': 788, 'n_tokens_neox': 754, 'n_words': 177, 'path': 'examples/Hello_World.ipynb', 'repo_name': 'NVlabs/sionna', 'size': '2177'}