Exemplo n.º 1
0
import numpy as np
import scipy as sc
import simpy as sp
import simutime as st
from commpy import modulation as mod
from commpy import channels as ch
from commpy import channelcoding
from commpy import utilities as utils

YEARS = float(sys.argv[7])
SEED = int(sys.argv[8])
np.random.seed(SEED)

CENTER_FREQ=700e6
BANDWIDTH = 40e6
SIMULATION_TIME=st.seconds(YEARS*365*24*3600)
PKT_LOSS = 0
TX_PKTS = 0

betaOffset = [0, 0] + [1.125 + i*0.125 for i in range(2)]+[1.625 + i*0.25 for i in range(4)]+[2.875, 3.125, 3.5, 4, 5, 6.25]

def snrToCqi(snr):
    cqi = 1
    if snr >= 4  and snr<6:
        cqi += 1
    elif snr>=6 and snr<8:
        cqi += 2
    elif snr>=8 and snr<10:
        cqi += 3
    elif snr>=10 and snr<12:
        cqi += 4
Exemplo n.º 2
0
from commpy import channelcoding
from commpy import utilities as utils
'''
from gnuradio import blocks
from gnuradio import fft
from gnuradio import channels
from gnuradio import digital
from gnuradio import fec
import gnuradio as gr
import physical-layer as phy
'''
SEED = int(sys.argv[1])
np.random.seed(SEED)

CENTER_FREQ = 700e3
SIMULATION_TIME = st.seconds(24 * 3600)
'''
class Transmitter(gr.hier_block2):
    def __init__(self, channelCoding, codingRate, blockLen):
        self.coding = channelCoding
        self.rate = codingRate
        self.blockLen = blockLen
        gr.hier_block2.__init__(self, "HierBlock",gr.io_signature(1, 1, gr.sizeof_char),
                gr.io_signature(1, 2, gr.sizeof_gr_complex))

        ofdm = phy.ofdm_tx()
        scrambler = 
        encoder = fec.encoder()
        crc = 
        self.connect(self, block1)
        self.connect(blockn, self)