[Top][All Lists]

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

[Discuss-gnuradio] help with USRP syntax

From: Josh Blum
Subject: [Discuss-gnuradio] help with USRP syntax
Date: Sun, 07 Jan 2007 03:13:28 -0500
User-agent: Thunderbird (X11/20061115)

Greetings. I am trying to understand the usrp programming syntax so that I can add USRP support into GRC. Below are a few code snippets from the USRP sample codes. It seems that rx_subdev_spec can be a tuple (0, 0) or (1, 0). Would this mean that for tx modules, the tx_subdev_spec is (1, 1) or (0, 1)? Each tuple corresponds to one of the 4 USRP module-sockets? I noticed that the last 3 of my examples set a mux, and use subdev. However, the first example is wildly different (I assume the command are different for different modules?). Is there some way I can find out what type of commands I need to use for various USRP modules?

The commands involving the subdev are used to set the gain (obviously), but sometimes you also have to call subdev.set_enable(True)?

Sorry for potentially stupid questions. I am not too familiar with the USRP, and I would like some advice.

Thank you, -Josh


u = usrp.sink_c (0, self.usrp_interp)

u.set_tx_freq (0, options.cordic_freq)

u.set_pga (0, options.gain)

u.set_pga (1, options.gain)


self.u = usrp.sink_c ()       # the USRP sink (consumes samples)

options.tx_subdev_spec = usrp.pick_tx_subdevice(self.u)

m = usrp.determine_tx_mux_value(self.u, options.tx_subdev_spec)


self.subdev = usrp.selected_subdev(self.u, options.tx_subdev_spec)

self.subdev.set_gain(self.subdev.gain_range()[1])    # set max Tx gain

self.subdev.set_enable(True)                         # enable transmitter


self.u = usrp.source_c()                    # usrp is data source


self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))

self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)


u = usrp.source_c(USRP_number, decimation)

u.set_mux(usrp.determine_rx_mux_value(u, options.rx_subdev_spec))

subdev = usrp.selected_subdev(u, options.rx_subdev_spec)

u.tune(USRP_number, subdev, frequency)


reply via email to

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