Ejemplo n.º 1
0
def main():
    parser = OptionParser(conflict_handler="resolve")
    expert_grp = parser.add_option_group("Expert")

    fbmc_benchmark.add_options(parser, expert_grp)
    transmit_path.add_options(parser, expert_grp)
    receive_path.add_options(parser, expert_grp)
    fusb_options.add_options(expert_grp)

    parser.add_option("-c",
                      "--cfg",
                      action="store",
                      type="string",
                      default=None,
                      help="Specifiy configuration file, default: none",
                      config="false")

    (options, args) = parser.parse_args()

    if options.cfg is not None:
        (options, args) = parser.parse_args(files=[options.cfg])
        print "Using configuration file %s" % (options.cfg)

    benchmark = fbmc_benchmark(options)
    runtime = benchmark

    r = gr.enable_realtime_scheduling()
    if r != gr.RT_OK:
        print "Couldn't enable realtime scheduling"
    else:
        print "Enabled realtime scheduling"

    try:

        if options.dot_graph:
            string_benchmark = runtime.dot_graph()
            filetx = os.path.expanduser('~/omnilog/benchmark_fbmc.dot')
            filetx = os.path.expanduser('benchmark_fbmc.dot')
            dot_file = open(filetx, 'w')
            dot_file.write(string_benchmark)
            dot_file.close()

        runtime.run()
        try:
            tx.txpath._control._id_source.ready()
        except:
            pass

    except KeyboardInterrupt:
        runtime.stop()
        # somewhat messy hack
        #    try:
        #      rx.rxs_msgq.flush()
        #      rx.rxs_msgq.insert_tail(gr.message(1))
        #    except:
        #      print "Could not flush msgq"
        #      pass
        runtime.wait()

    if options.measure:
        print "min", tx.m.get_min()
        print "max", tx.m.get_max()
        print "avg", tx.m.get_avg()
Ejemplo n.º 2
0
def main():
  parser = OptionParser(conflict_handler="resolve")
  expert_grp = parser.add_option_group("Expert")

  fbmc_benchmark.add_options(parser, expert_grp)
  transmit_path.add_options(parser, expert_grp)
  receive_path.add_options(parser, expert_grp)
  fusb_options.add_options(expert_grp)

  parser.add_option(
    "-c", "--cfg",
    action="store", type="string", default=None,
    help="Specifiy configuration file, default: none",
    config="false" )

  (options, args) = parser.parse_args()

  if options.cfg is not None:
    (options,args) = parser.parse_args(files=[options.cfg])
    print "Using configuration file %s" % ( options.cfg )

  benchmark = fbmc_benchmark(options)
  runtime = benchmark

  r = gr.enable_realtime_scheduling()
  if r != gr.RT_OK:
    print "Couldn't enable realtime scheduling"
  else:
    print "Enabled realtime scheduling"

  try:

    if options.dot_graph:
      string_benchmark = runtime.dot_graph()
      filetx = os.path.expanduser('~/omnilog/benchmark_fbmc.dot')
      filetx = os.path.expanduser('benchmark_fbmc.dot')
      dot_file = open(filetx,'w')
      dot_file.write(string_benchmark)
      dot_file.close()

    runtime.run()
    try:
      tx.txpath._control._id_source.ready()
    except:
      pass

  except KeyboardInterrupt:
    runtime.stop()
    # somewhat messy hack
#    try:
#      rx.rxs_msgq.flush()
#      rx.rxs_msgq.insert_tail(gr.message(1))
#    except:
#      print "Could not flush msgq"
#      pass
    runtime.wait()


  if options.measure:
    print "min",tx.m.get_min()
    print "max",tx.m.get_max()
    print "avg",tx.m.get_avg()
Ejemplo n.º 3
0
    def add_options(normal, expert):
        """
    Adds usrp-specific options to the Options Parser
    """
        common_options.add_options(normal, expert)
        transmit_path.add_options(normal, expert)
        receive_path.add_options(normal, expert)

        #    normal.add_option("-T", "--tx-subdev-spec", type="subdev", default=None,
        #                      help="select USRP Tx side A or B")
        expert.add_option(
            "",
            "--tx-freq",
            type="eng_float",
            default=0.0,
            help="set transmit frequency to FREQ [default=%default]",
            metavar="FREQ")
        normal.add_option("",
                          "--measure",
                          action="store_true",
                          default=False,
                          help="enable troughput measure, usrp disabled")

        #    normal.add_option("", "--dyn-freq", action="store_true", default=False,
        #                      help="enable troughput measure, usrp disabled");

        expert.add_option("",
                          "--snr",
                          type="eng_float",
                          default=None,
                          help="Simulate AWGN channel")
        expert.add_option("",
                          "--freqoff",
                          type="eng_float",
                          default=None,
                          help="Simulate frequency offset [default=%default]")
        expert.add_option(
            "",
            "--samplingoffset",
            type="eng_float",
            default=None,
            help="Simulate sampling frequency offset [default=%default]")
        expert.add_option("",
                          "--multipath",
                          action="store_true",
                          default=False,
                          help="Enable multipath channel")
        expert.add_option("",
                          "--itu-channel",
                          action="store_true",
                          default=False,
                          help="Enable itu channel model (ported from itpp)")
        expert.add_option(
            "",
            "--online-work",
            action="store_true",
            default=False,
            help=
            "Force the ofdm transmitter to work during file record [default=%default]"
        )
        #    normal.add_option("", "--from-file", type="string", default=None,
        #                      help="Sent recorded stream with usrp")
        #    normal.add_option("", "--to-file", type="string", default=None,
        #                      help="Record transmitter to disk, not being sent to usrp")

        expert.add_option(
            "",
            "--force-tx-filter",
            action="store_true",
            default=False,
            help="force filter use while transmitting to file or measuring")

        expert.add_option(
            "",
            "--force-rx-filter",
            action="store_true",
            default=False,
            help="force filter use while transmitting to file or measuring")

        #    expert.add_option("", "--nullsink", action="store_true",
        #                      default=False,
        #                      help="Throw away samples")

        #    normal.add_option("-e", "--interface", type="string", default="eth0",
        #                          help="select Ethernet interface, default is eth0")
        #    normal.add_option("-m", "--mac-addr", type="string", default="",
        #                          help="select USRP by MAC address, default is auto-select")
        #    normal.add_option("", "--usrp2", action="store_true", default=False,
        #                      help="Use USRP2 Interface")

        expert.add_option("",
                          "--record",
                          action="store_true",
                          default=False,
                          help="Record transmission stream")
        expert.add_option("",
                          "--berm",
                          action="store_true",
                          default=False,
                          help="BER measurement -> set fixed noise power ")

        expert.add_option("",
                          "--stations",
                          type="intx",
                          default=1,
                          help="Mobile station count")

        expert.add_option(
            "",
            "--sinr-est",
            action="store_true",
            default=False,
            help="Enable SINR per subcarrier estimation [default=%default]")

        expert.add_option(
            "",
            "--est-preamble",
            type="int",
            default=0,
            help="the number of channel estimation preambles (1 or 2)")
        normal.add_option("",
                          "--event-rxbaseband",
                          action="store_true",
                          default=False,
                          help="Enable RX baseband via event channel alps")

        normal.add_option("",
                          "--imgxfer",
                          action="store_true",
                          default=False,
                          help="Enable IMG Transfer mode")
Ejemplo n.º 4
0
  def add_options(normal, expert):
    """
    Adds usrp-specific options to the Options Parser
    """
    common_options.add_options(normal,expert)
    transmit_path.add_options(normal,expert)
    receive_path.add_options(normal,expert)

#    normal.add_option("-T", "--tx-subdev-spec", type="subdev", default=None,
#                      help="select USRP Tx side A or B")
    expert.add_option("", "--tx-freq", type="eng_float", default=0.0,
                      help="set transmit frequency to FREQ [default=%default]", metavar="FREQ");
    normal.add_option("", "--measure", action="store_true", default=False,
                      help="enable troughput measure, usrp disabled");

#    normal.add_option("", "--dyn-freq", action="store_true", default=False,
#                      help="enable troughput measure, usrp disabled");

    expert.add_option("", "--snr", type="eng_float", default=None,
                      help="Simulate AWGN channel");
    expert.add_option("", "--freqoff", type="eng_float", default=None,
                      help="Simulate frequency offset [default=%default]")
    expert.add_option("", "--samplingoffset", type="eng_float", default=None,
                      help="Simulate sampling frequency offset [default=%default]")
    expert.add_option("", "--multipath", action="store_true", default=False,
                      help="Enable multipath channel")
    expert.add_option("", "--itu-channel", action="store_true", default=False,
                      help="Enable itu channel model (ported from itpp)")
    expert.add_option("", "--online-work", action="store_true", default=False,
                      help="Force the ofdm transmitter to work during file record [default=%default]")
#    normal.add_option("", "--from-file", type="string", default=None,
#                      help="Sent recorded stream with usrp")
#    normal.add_option("", "--to-file", type="string", default=None,
#                      help="Record transmitter to disk, not being sent to usrp")

    expert.add_option("", "--force-tx-filter", action="store_true", default=False,
                      help="force filter use while transmitting to file or measuring")

    expert.add_option("", "--force-rx-filter", action="store_true", default=False,
                      help="force filter use while transmitting to file or measuring")

#    expert.add_option("", "--nullsink", action="store_true",
#                      default=False,
#                      help="Throw away samples")

#    normal.add_option("-e", "--interface", type="string", default="eth0",
#                          help="select Ethernet interface, default is eth0")
#    normal.add_option("-m", "--mac-addr", type="string", default="",
#                          help="select USRP by MAC address, default is auto-select")
#    normal.add_option("", "--usrp2", action="store_true", default=False,
#                      help="Use USRP2 Interface")


    expert.add_option("", "--record", action="store_true",
                      default=False,
                      help="Record transmission stream")
    expert.add_option("", "--berm", action="store_true",
                      default=False,
                      help="BER measurement -> set fixed noise power ")

    expert.add_option("", "--stations", type="intx", default=1,
                      help="Mobile station count")

    expert.add_option("", "--sinr-est", action="store_true", default=False,
                      help="Enable SINR per subcarrier estimation [default=%default]")

    expert.add_option("", "--est-preamble", type="int", default=0,
                      help="the number of channel estimation preambles (1 or 2)")
    normal.add_option(
      "", "--event-rxbaseband",
      action="store_true", default=False,
      help = "Enable RX baseband via event channel alps" )

    normal.add_option(
      "", "--imgxfer",
      action="store_true", default=False,
      help="Enable IMG Transfer mode")