<jupyter_start><jupyter_text>Settup<jupyter_code>%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt

plt.rcParams['axes.labelsize']=16
plt.rcParams['xtick.labelsize']=16
plt.rcParams['ytick.labelsize']=16
plt.rcParams['legend.fontsize']=14
plt.rcParams['lines.linewidth'] = 2
plt.rcParams['lines.markersize'] = 10
plt.rcParams['axes.labelsize'] = 20<jupyter_output><empty_output><jupyter_text>MIMO Channels<jupyter_code>from symbols import SymbolGenerator, MLdecoder
from channels import KroneckerRayleighChannelMIMO, calculateBERfast
from receivers import MMRC
import numpy as np

snr = np.array(range(-10,10))
Rt = np.array([[1]])
Rr = np.array([[1,0],[0,1]])

#set the random number generator to get the same 'random' channel
ch_unc = KroneckerRayleighChannelMIMO(1,2,Rt,Rr,seed=42)

Rr = np.array([[1,0.1],[0.1,1]])
ch_cor01 = KroneckerRayleighChannelMIMO(1,2,Rt,Rr,seed=42)

Rr = np.array([[1,0.3],[0.3,1]])
ch_cor03 = KroneckerRayleighChannelMIMO(1,2,Rt,Rr, seed=42)
generator = SymbolGenerator(symbols = 'QPSK')
decoder = MLdecoder('QPSK')

mmrc_unc = MMRC(2,ch_unc)
mmrc_cor01 = MMRC(2,ch_cor01)
mmrc_cor03 = MMRC(2,ch_cor03)
y_unc = calculateBERfast(ch_unc, mmrc_unc, decoder, generator,snr,Nsymbols=10000, iterations = 10, verbose=False)
y_cor01 = calculateBERfast(ch_cor01, mmrc_cor01, decoder, generator,snr,Nsymbols=10000, iterations = 10, verbose=False)
y_cor03 = calculateBERfast(ch_cor03, mmrc_cor03, decoder, generator,snr,Nsymbols=10000, iterations = 10, verbose=False)
plt.figure(figsize=(20,15))

single = plt.semilogy(snr,y_unc,linestyle='--',marker='o', color='b', label='Uncorrelated Receiver Antennas')
double = plt.semilogy(snr,y_cor01, linestyle='-.',marker='>', color='y', label='Correlation = 0.1')
quintuple = plt.semilogy(snr,y_cor03,linestyle=':',marker='^', color='r', label = 'Correlation = 0.3')
plt.ylabel('BER')
plt.xlabel('Eb/No')
plt.legend(fontsize='xx-large')
plt.grid(b=True, which='major')
plt.grid(b=True, which='minor')
Rt = np.array([[1]])
Rr1 = np.identity(1)
Rr3 = np.identity(3)
Rr5 = np.identity(5)

ch1 = KroneckerRayleighChannelMIMO(1,1,Rt,Rr1)
ch3 = KroneckerRayleighChannelMIMO(1,3,Rt,Rr3)
ch5 = KroneckerRayleighChannelMIMO(1,5,Rt,Rr5)


mmrc1 = MMRC(1,ch1)
mmrc3 = MMRC(3,ch3)
mmrc5 = MMRC(5,ch5)


y1 = calculateBERfast(ch1, mmrc1, decoder, generator,snr,Nsymbols=10000, iterations = 10, verbose=False)
y3 = calculateBERfast(ch3, mmrc3, decoder, generator,snr,Nsymbols=10000, iterations = 10, verbose=False)
y5 = calculateBERfast(ch5, mmrc5, decoder, generator,snr,Nsymbols=10000, iterations = 10, verbose=False)
plt.figure(figsize=(20,15))

single = plt.semilogy(snr,y1,linestyle='--',marker='o', color='b', label='Nr = 1')
double = plt.semilogy(snr,y3, linestyle='-.',marker='>', color='y', label='Nr = 3')
quintuple = plt.semilogy(snr,y5,linestyle=':',marker='^', color='r', label = 'Nr = 5')
plt.ylabel('BER')
plt.xlabel('Eb/No')
plt.legend(fontsize='xx-large')
plt.grid(b=True, which='major')
plt.grid(b=True, which='minor')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17705242334322452, 'fraction_numerical': 0.057368941641938676, 'mean_word_length': 8.48125, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '315191', 'license': 'MIT', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1246, 'n_words': 194, 'path': 'Class Testing Results.ipynb', 'repo_name': 'HectorTa1989/MIMO-PHY-security-with-Eavesdropper', 'size': '3033'}