[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] question about Simple Transmitter(2)

From: mehdimolu
Subject: [Discuss-gnuradio] question about Simple Transmitter(2)
Date: Mon, 16 Jun 2008 07:52:39 -0700 (PDT)

When I run the code, I don't receive error but >>uU<< appears on my desktop.
I want to run a transmitter which transmits a file. I don't see anything
around center frequency.
please somebody guide me. I am really confused.
the code is 

#!/usr/bin/env python
from gnuradio import gr, gru, modulation_utils
from gnuradio import usrp
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from gnuradio import blks2impl
from gnuradio import blks2

import random, time, struct, sys

# from current dir
#from transmit_path import transmit_path
#import fusb_options

def build_graph():
        payload_bytesize = 16
        mysamples_per_symbol = 3 
        myexcess_bw = 0.35
        mygray_code = True
        myverbose= False
        mylog= False
        txfreq = 2.5e9
        interpolation = 16
        chan = 1        
        gain = 1
        fg = gr.top_block ()
        #in this step we need to define the file we want to transmit
        Bsrc = gr.file_source (gr.sizeof_char,
"/home/usrp2user/PDF/payload.pdf", False)
        Bframing = gr.simple_framer ( payload_bytesize )
        Bdbpsk = blks2.dbpsk_mod(mysamples_per_symbol, myexcess_bw,
mygray_code, myverbose, mylog)
        Bamp = gr.multiply_const_cc(8192)
        Busrptx = usrp.sink_c(0)
        subdev_spec = usrp.pick_tx_subdevice(Busrptx)  # choose daughterboard A 
your Tx.
        Busrptx.set_mux(usrp.determine_tx_mux_value(Busrptx, subdev_spec))      
        subdev = usrp.selected_subdev(Busrptx,subdev_spec) # now we got the
chosen(last line) daughterboard

        subdev.set_enable(True)  #enabling transmit :just in flex boards        
        # x=subdev.gain_range()
        Busrptx.tune(subdev._which, subdev, txfreq)
        #usrp.sink_c.tune(Busrptx, chan, subdev, txfreq)

        fg.connect(Bsrc, (Bframing, 0))
        #fg.connect((Bframing, (Bdbpsk, 0))
        #fg.connect((Bdbpsk, 1), Busrptx)
        fg.connect(Bframing, Bdbpsk)
        fg.connect(Bdbpsk, Bamp)        
        fg.connect(Bamp, Busrptx)
        return fg

if __name__ == '__main__': 
        fg = build_graph ()


View this message in context: 
Sent from the GnuRadio mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]