Where the carrier frequency is set

Eric has already told me once that this is crazy, but I can’t see any
other
way to do this. When Matt told me that the RSSI circuit measures
interference +/-15Mhz from the carrier, I naturally went to the code for
the
read_aux_adc() function in usrp_prims.{cc,h} in order to see where the
carrier frequency comes into play. I wanted to know where in the code I
should be changing the carrier frequency. Just as I’ve been told, the
code
is confusing. I’ve read all the tutorials, I’m pretty knowledgeable
about
both python and C++; I’m not confused about the basic syntax of either
language. Honestly, between the lack of comments for variables, and
every
file being inherited from some other class file, it’s extremely easy to
get
lost in the code.

On Fri, Jul 28, 2006 at 02:01:25PM -0500, Michael F. wrote:

language. Honestly, between the lack of comments for variables, and every
file being inherited from some other class file, it’s extremely easy to
get lost in the code.

Michael,

To tune, use the u.tune(…) method. It’s not hard to use; it works
with all daughterboards. It accounts for the RF front-end’s finite
PLL step size, and manages the digital down converter.

FYI, we call the thing you’re calling “carrier frequency” the “center
frequency”. These two concepts are not necessarily tightly
coupled. There could be many carriers in a digitized stream of
samples, and carrier(s) may not be at the center frequency.

Do you understand the comments below about tuning being a “two-step
process”? On the RFX boards, the PLL step size is 4 MHz.

Also, the return value from tune is an instance of tune_result which
can be examined to see how everything was setup. baseband_freq is the
RF frequency that corresponds to DC in the RF front-end’s IF output
(the input to the A/D’s and from there to the digital down-converter).
Note that this isn’t necessarily the location of the signal of
interest. Some daughterboards have the signal of interest at a
non-zero IF frequency. dxc_freq is the frequency value used in the
digital down or up converter. residual_freq is a very small number on
the order of 1/100 of a Hz. It can be ignored. Inverted is true if
the spectrum is inverted, and we weren’t able to fix it for you.

On the receive path, the end result of tune is that the signal at the
given target RF frequency ends up at DC in the complex baseband input
from the USRP.

From usrp.py:

class tune_result(object):
“”"
Container for intermediate tuning information.
“”"
def init(self, baseband_freq, dxc_freq, residual_freq,
inverted):
self.baseband_freq = baseband_freq
self.dxc_freq = dxc_freq
self.residual_freq = residual_freq
self.inverted = inverted

def tune(u, chan, subdev, target_freq):
“”"
Set the center frequency we’re interested in.

@param u: instance of usrp.source_* or usrp.sink_*
@param chan: DDC/DUC channel
@type  chan: int
@param subdev: daughterboard subdevice
@param target_freq: frequency in Hz
@returns False if failure else tune_result

Tuning is a two step process.  First we ask the front-end to
tune as close to the desired frequency as it can.  Then we use
the result of that operation and our target_frequency to
determine the value for the digital down converter.
"""

Eric

Eric,

You’re right, I should have referred to the ‘carrier freqency’ as the
‘center frequency.’ That’s what I meant; I apoligize for not being
clear.

On the second note, I don’t understand the second step of the 2-part
process. Also, I don’t understand what I should be setting the channel
to. I
have a background in network protocols, but I have yet to take a DSP
course.
Make no mistake, I’ve signed up for it this coming semester.

-Michael F.-

Sorry, I didn’t mean ‘channel.’ I meant the subdevice.

Eric

so I’ve been running this in python interactive mode, just to test.
after
searching around, I found this following post from you:

http://www.mail-archive.com/[email protected]/msg02044.html

I know it was written last September, but I figured I’d give things a
shot.

I’m doing the following once I get into python:

from gnuradio import usrp
u = usrp.source_c(0,64)
u.tune(0, u.db[0][0], 2.4e6)
False

No matter what I set the channel to, I always get a false value
returned. I
know this corresponds to ‘ok’ being set to False in lines 136-140 of
usrp.py
:

136 if rx_p:
137 ok = ok and u.set_rx_freq(chan, dxc_freq)
138 else:
139 dxc_freq = -dxc_freq
140 ok = ok and u.set_tx_freq(chan, dxc_freq)

As it turns out, ‘rx_p’ is True, and ‘u.set_rx_freq(chan, dxc_freq)’ is
True, but ‘ok’ is False before line 137 is reached. That means that
something is happening at line 122 that sets ‘ok’ to False.

122 ok, baseband_freq = subdev.set_freq(target_freq)

As I’m using a FLEX2400 transceiver daughterboard with a range of
2.3-2.9GHz (Information from the Ettus website), and the tune()
function takes the
frequency in Hz, I thought that using 2.4e6 would be okay. Is there
something I’m doing incorrectly? Channel, subdevice, etc.?

-Michael F.-

On Sun, Jul 30, 2006 at 05:38:39PM -0500, Michael F. wrote:

Eric

so I’ve been running this in python interactive mode, just to test. after
searching around, I found this following post from you:

http://www.mail-archive.com/[email protected]/msg02044.html

I know it was written last September, but I figured I’d give things a shot.

Does usrp_fft.py work for you?
If yes, make your code look like that code.
If no, figure out what’s broken on your system/install.

Eric

On Sun, Jul 30, 2006 at 03:09:40PM -0500, Michael F. wrote:

process. Also, I don’t understand what I should be setting the channel to.
I
have a background in network protocols, but I have yet to take a DSP
course.
Make no mistake, I’ve signed up for it this coming semester.

-Michael F.-

Please look at the examples.

E.g., gnuradio-examples/python/usrp/usrp_wfm_rcv_nogui.py or usrp_fft.py

Eric

Michael F. wrote:

Eric has already told me once that this is crazy, but I can’t see any
other way to do this. When Matt told me that the RSSI circuit
measures interference +/-15Mhz from the carrier,

The RSSI reads the power in the analog baseband signals (power(I) +
power(Q)). The analog baseband will contain signals from approximately
+/- 15 MHz from the LO frequency. The LO frequency is set automatically
when you set the frequency of reception. The LO is a multiple of 2 or 4
MHz depending on which RFX board you have. You can change that to be a
multiple of 1 MHz, but you will have worse phase noise. The lo_offset
also needs to be taken into account.

Matt

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs