Beispiel #1
0
  def setup_imgtransfer_sink(self):
    demod = self._data_demodulator

    config = station_configuration()

    port = self._rx_control.add_mobile_station(config.rx_station_id)
    bc_src = (self._rx_control,port)

    UDP_PACKET_SIZE = 4096*8

    imgtransfersink = ofdm.imgtransfer_sink( UDP_PACKET_SIZE,
                                     "localhost", 0, "localhost", 45454,
                                     self._options.img, False )


    #imgtransfersink = ofdm.imgtransfer_sink(UDP_PACKET_SIZE,self._options.img,
    #                                        False)
    #udpsink = gr.udp_sink( 1, "127.0.0.1", 0, "127.0.0.1", 45454,
    #                       UDP_PACKET_SIZE )
    #udpsink = blocks.null_sink( gr.sizeof_char )

    self.connect( bc_src, ( imgtransfersink, 0 ) )
    self.connect( demod,  ( imgtransfersink, 1 ) )
    #self.connect( imgtransfersink, udpsink )

    self._measuring_ber = True
    self._img_xfer_inprog = True

    self.imgxfer_sink = imgtransfersink
    self._ber_measuring_tool = None
    def __init__(self):
        gr.top_block.__init__(self)
        sig_src = gr.sig_source_i(200,gr.GR_CONST_WAVE,0,0,3600)
        src = ofdm.imgtransfer_src( "test.bmp" )

        UDP_PACKET_SIZE = 4096

        imgsink = ofdm.imgtransfer_sink( UDP_PACKET_SIZE,
                                         "127.0.0.1", 0, "127.0.0.1", 45454, "test.bmp" )

        self.connect(sig_src,(src,0))
        self.connect(sig_src,(imgsink,0))

        self.connect(src,(imgsink,1))
    def __init__(self):
        gr.top_block.__init__(self)
        sig_src = gr.sig_source_i(200, gr.GR_CONST_WAVE, 0, 0, 3600)
        src = ofdm.imgtransfer_src("test.bmp")

        UDP_PACKET_SIZE = 4096

        imgsink = ofdm.imgtransfer_sink(UDP_PACKET_SIZE, "127.0.0.1", 0,
                                        "127.0.0.1", 45454, "test.bmp")

        self.connect(sig_src, (src, 0))
        self.connect(sig_src, (imgsink, 0))

        self.connect(src, (imgsink, 1))
Beispiel #4
0
    def __init__(self):
        gr.top_block.__init__(self)
        #sig_src = gr.sig_source_i(512,gr.GR_SIN_WAVE,0.1,1000,3600)
        sig_src = gr.sig_source_i(200, gr.GR_CONST_WAVE, 0, 0, 3600)
        #sig_src = gr.noise_source_i(gr.GR_UNIFORM, 1000)
        src_file = "test.bmp"
        src = ofdm.imgtransfer_src(src_file)
        err_src = ofdm.bernoulli_bit_src(0.01)
        test_channel = ofdm.imgtransfer_testkanal()

        sequenz = [0] * 256
        for i in range(256):
            sample = random()
            if sample < 0.1:
                sequenz[i] = randint(-100, 100) * 3

        print sequenz

        vector_src = gr.vector_source_i(sequenz, True)
        add_block = gr.add_ii()

        self.connect(vector_src, (add_block, 0))
        self.connect(sig_src, (add_block, 1))

        xor = gr.xor_bb()

        UDP_PACKET_SIZE = 4096

        imgsink = ofdm.imgtransfer_sink(UDP_PACKET_SIZE, "127.0.0.1", 0,
                                        "127.0.0.1", 45454, src_file)

        self.connect(sig_src, (src, 0))
        self.connect(sig_src, (test_channel, 0))
        self.connect(add_block, (imgsink, 0))

        self.connect(src, (test_channel, 1))
        self.connect(vector_src, (test_channel, 2))

        self.connect(test_channel, (xor, 0))
        self.connect(err_src, (xor, 1))

        self.connect(xor, (imgsink, 1))
Beispiel #5
0
    def __init__(self):
        gr.top_block.__init__(self)
        #sig_src = gr.sig_source_i(512,gr.GR_SIN_WAVE,0.1,1000,3600)
        sig_src = gr.sig_source_i(200,gr.GR_CONST_WAVE,0,0,3600)
        #sig_src = gr.noise_source_i(gr.GR_UNIFORM, 1000)
        src_file = "test.bmp"
        src = ofdm.imgtransfer_src( src_file )
        err_src = ofdm.bernoulli_bit_src( 0.01 )
        test_channel = ofdm.imgtransfer_testkanal()

        sequenz = [0]*256
        for i in range(256):
          sample = random()
          if sample<0.1:
            sequenz[i]=randint(-100,100)*3

        print sequenz

        vector_src = gr.vector_source_i(sequenz,True)
        add_block = gr.add_ii()

        self.connect(vector_src,(add_block,0))
        self.connect(sig_src,(add_block,1))

        xor = gr.xor_bb()

        UDP_PACKET_SIZE = 4096

        imgsink = ofdm.imgtransfer_sink( UDP_PACKET_SIZE, "127.0.0.1", 0, "127.0.0.1", 45454, src_file )

        self.connect(sig_src,(src,0))
        self.connect(sig_src,(test_channel,0))
        self.connect(add_block,(imgsink,0))

        self.connect(src,(test_channel,1))
        self.connect(vector_src,(test_channel,2))

        self.connect(test_channel,(xor,0))
        self.connect(err_src,(xor,1))

        self.connect(xor,(imgsink,1))