<jupyter_start><jupyter_text>Dual Channel Simultanuous Transmission :  Setting up the environment:* import required python modules* Load the bitfile containing the block design<jupyter_code>from pynq import Overlay
import iotSDR.iotSDR_streams as SDR
import iotSDR.iotSDR_defs as channels

import matplotlib.pyplot as plt
plt.style.use(['dark_background'])

iot_overlay = Overlay('../bitstream/iotSDR_IOT.bit',download=True)
iotSDR = SDR.iotSDR_stream(iot_overlay)

tx_chan1   = channels.chan_subGHz_A
tx_chan2   = channels.chan_subGHz_B

#tx_chan   = iotSDR_defs.chan_24GHz_B
#rx_chan   = iotSDR_defs.chan_24GHz_A<jupyter_output><empty_output><jupyter_text>Setting iotSDR Frequency- Center Frequency of the<jupyter_code>cent_frequency_kHz = 918e6  # channel carrier freq 
chan_spacing_kHz   = 25     # channel spacing w.r.t carrier freq
chan_number        = 1      # channel offset in multiple of channel spacing w.r.t carrier freq

iotSDR.setFrequency(tx_chan1,cent_frequency_kHz,chan_spacing_kHz,chan_number)
iotSDR.setFrequency(tx_chan2,cent_frequency_kHz,chan_spacing_kHz,chan_number+200)

cyclic_mode = True
tx_stream_1 = iotSDR.initStream(channels.IOTSDR_TX,tx_chan1,cyclic_mode)
tx_stream_2 = iotSDR.initStream(channels.IOTSDR_TX,tx_chan2,cyclic_mode)
iotSDR.activateStream(tx_stream_1)
iotSDR.activateStream(tx_stream_2)

import time
import numpy as np


f = 30 #Hz
N = 1*1024

t = np.linspace(0, 1, N,endpoint=False)
real = np.cos(2*np.pi*f*t)*1
imag = np.sin(2*np.pi*f*t)*1

tx_samples = real + 1j*imag


fig, axes= plt.subplots(nrows=1, ncols=1,figsize=(16,3))

n = np.arange(0, N, 1)
axes.plot(n, tx_samples.real[:])
axes.plot(n, tx_samples.imag[:])

plt.tight_layout()
plt.show()

"""
Create continous memory buffer for DAC transmit samples
this buffer will be filled up by the streamed samples and transmitted through the RF chip
"""
from pynq import allocate 

totalSamples    = len(tx_samples)
ADC_SAMPLE_BITs = 14

tx_sample_buffer = allocate(shape=(totalSamples*2,), dtype=np.int16)

tx_sample_buffer[0::2] = (2**ADC_SAMPLE_BITs-1)* tx_samples.real
tx_sample_buffer[1::2] = (2**ADC_SAMPLE_BITs-1)* tx_samples.imag

iotSDR.writeStream(tx_stream_1,tx_sample_buffer)
iotSDR.writeStream(tx_stream_2,tx_sample_buffer)

tx_sample_buffer.close()
iotSDR.deactivateStream(tx_stream_1)
iotSDR.deactivateStream(tx_stream_2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10165184243964422, 'fraction_numerical': 0.02626005929690809, 'mean_word_length': 6.769736842105263, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '143980', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 965, 'n_tokens_neox': 912, 'n_words': 168, 'path': 'boards/iotSDR-IOT_Z7020/iotSDR_IOT/notebooks/iotSDR_Dual_channel_transmission.ipynb', 'repo_name': 'mfkiwl/iotSDR', 'size': '2361'}