USRP2 + WBX: Unable to receive FM signals

Hi,
I’m using USRP2 + WBX, with the SMA connector connected to the
RX/TX connector, and I’ve stuck a piece of wire about 7" long into the
SMA connector.

However, when I run the following command, I get only static.

./usrp2_wfm_rcv.py -e eth2
Using RX d’board 0x0053
This daughterboard does not cover the required frequency range
for this application. Please use a BasicRX or TVRX daughterboard.
Press ENTER to continue anyway, or Ctrl-C to exit.

gr_fir_ccf: using SSE
gr_fir_fff: using SSE
aUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaU

The WBX has a range of 50MHz to 2.2GHz, so it does cover the frequency
range. What’s it’s dbid, so that I can add it to the script?

if not (dbid == 0x0001 or #usrp_dbid.BASIC_RX
dbid == 0x0003 or #usrp_dbid.TV_RX
dbid == 0x000c or #usrp_dbid.TV_RX_REV_2
dbid == 0x0040 or #usrp_dbid.TV_RX_REV_3
dbid == 0x0043 or #usrp_dbid.TV_RX_MIMO
dbid == 0x0044 or #usrp_dbid.TV_RX_REV_2_MIMO
dbid == 0x0045 or #usrp_dbid.TV_RX_REV_3_MIMO
dbid == 0x00??): #usrp_dbid.WBX

Elvis D.

0x0052 should be the id of the WBX RX side. Let me know how it goes, and
send back the patch!

Thanks,
-Josh

Hi Josh,

On Jul 15, 2010, at 10:36 PM, Josh B. wrote:

0x0052 should be the id of the WBX RX side. Let me know how it goes, and send back the patch!

Maybe it’s 0x0053, because that’s what the program reports it is using:

$ ./usrp2_wfm_rcv.py -e eth2

Using RX d’board 0x0053

gr_fir_ccf: using SSE
gr_fir_fff: using SSE
aUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaU

However, I get nothing but static when I run the program. What could be
wrong? I tried connecting the antenna to both J3 and J2, and I still get
static.

Elvis D.

Hi,
I increased the length of the wire to around 50cm, and increased
the volume and gain sliders to maximum, and could hear some semblance of
an FM radio transmission, but it was completely distorted.

What settings should I use to get better quality FM reception. I thought
this would work easily out of the box.

Elvis D.

On 15 July 2010 22:43, Elvis D. [email protected] wrote:

Hi,
I modified the usrp_decimation to 210, which gives me an ouput of 476190 Hz for the audio sample output. This was the closest I could get it to work at 48KHz.

I still get broken FM audio output, and I constantly get the audio buffer under-run aUaU messages on the console.

Could someone please help me get the correct FM receiver output settings?

I suggest you leave the pre-demodulator settings as they are in the
example and add a rational resampler after the demodulator, see
examples/audio/test_resampler.py on how to use it.

Alex

Hi,
I modified the usrp_decimation to 210, which gives me an ouput of
476190 Hz for the audio sample output. This was the closest I could get
it to work at 48KHz.

I still get broken FM audio output, and I constantly get the audio
buffer under-run aUaU messages on the console.

Could someone please help me get the correct FM receiver output
settings?

I’m using the following command line parameters to start the program:

./usrp2_wfm_rcv.py -e eth2 -f 104.4 -V 0.0 -g 31 -O hw:0,0

Here is a patch of the modifications that I’ve made to the script so
far:

diff --git a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
index 1783660…84b7ef9 100755
— a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
+++ b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
@@ -69,11 +69,12 @@ class wfm_rx_block (stdgui2.std_top_block):
self.u = usrp2.source_32fc(options.interface, options.mac_addr)

     adc_rate = self.u.adc_rate()                # 100 MS/s
  •    usrp_decim = 312
    
  •    usrp_decim = 210
       self.u.set_decim(usrp_decim)
       usrp_rate = adc_rate / usrp_decim           # ~320 kS/s
       chanfilt_decim = 1
       demod_rate = usrp_rate / chanfilt_decim
    
  • print “demod_rate = %d” % (demod_rate)
    audio_decimation = 10
    audio_rate = demod_rate / audio_decimation # ~32 kHz

@@ -87,7 +88,8 @@ class wfm_rx_block (stdgui2.std_top_block):
dbid == 0x0040 or #usrp_dbid.TV_RX_REV_3
dbid == 0x0043 or #usrp_dbid.TV_RX_MIMO
dbid == 0x0044 or #usrp_dbid.TV_RX_REV_2_MIMO

  •            dbid == 0x0045 ): #usrp_dbid.TV_RX_REV_3_MIMO
    
  •            dbid == 0x0045 or #usrp_dbid.TV_RX_REV_3_MIMO
    
  • dbid == 0x0053 ): #usrp_dbid.WBX
    print “This daughterboard does not cover the required
    frequency range”
    print “for this application. Please use a BasicRX or TVRX
    daughterboard.”
    raw_input(“Press ENTER to continue anyway, or Ctrl-C to
    exit.”)

Elvis D.

Hi Alex,

On Jul 16, 2010, at 2:02 AM, Alexandru C. wrote:

I suggest you leave the pre-demodulator settings as they are in the
example and add a rational resampler after the demodulator, see
examples/audio/test_resampler.py on how to use it.

I looked at the rational resample example, and modified the
usrp2_wfm_rcv.py script. The results weren’t good, and it appeared that
the playback was re-sampled to a lower rate, with the music playing back
as if the speed was slowed down.

The audio_rate, when computed is 32051Hz, but using that value
completely hangs the system.

When I hard-code the value to 32050Hz, the system plays back, but at a
slower speed.

The output sample rate is set to 48000Hz.

I have attached the patch below, could you let me know if the
modifications are correct?

Elvis Dowsn

diff --git a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
index 1783660…0184725 100755
— a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
+++ b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
@@ -51,7 +51,10 @@ class wfm_rx_block (stdgui2.std_top_block):
help=“set volume (default is midpoint)”)
parser.add_option("-O", “–audio-output”, type=“string”,
default="",
help=“pcm device name. E.g., hw:0,0 or
surround51 or /dev/dsp”)

  •    parser.add_option("-i", "--input-rate", type="eng_float", 
    

default=32050,

  •                      help="set input sample rate to RATE 
    

(%default)")

  •    parser.add_option("-o", "--output-rate", type="eng_float", 
    

default=48000,

  •                      help="set output sample rate to RATE 
    

(%default)")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -66,6 +69,7 @@ class wfm_rx_block (stdgui2.std_top_block):

     # build graph
  •    # USRP2 source
       self.u = usrp2.source_32fc(options.interface, options.mac_addr)
    
       adc_rate = self.u.adc_rate()                # 100 MS/s
    

@@ -76,6 +80,7 @@ class wfm_rx_block (stdgui2.std_top_block):
demod_rate = usrp_rate / chanfilt_decim
audio_decimation = 10
audio_rate = demod_rate / audio_decimation # ~32 kHz

  •    print "audio rate =", audio_rate
    
       #FIXME: need named constants and text descriptions available to 
    

(gr-)usrp2 even
#when usrp(1) module is not built. A usrp_common module,
perhaps?
@@ -87,11 +92,13 @@ class wfm_rx_block (stdgui2.std_top_block):
dbid == 0x0040 or #usrp_dbid.TV_RX_REV_3
dbid == 0x0043 or #usrp_dbid.TV_RX_MIMO
dbid == 0x0044 or #usrp_dbid.TV_RX_REV_2_MIMO

  •            dbid == 0x0045 ): #usrp_dbid.TV_RX_REV_3_MIMO
    
  •            dbid == 0x0045 or #usrp_dbid.TV_RX_REV_3_MIMO
    
  •            dbid == 0x0053 ): #usrp_dbid.WBX
           print "This daughterboard does not cover the required 
    

frequency range"
print “for this application. Please use a BasicRX or TVRX
daughterboard.”
raw_input(“Press ENTER to continue anyway, or Ctrl-C to
exit.”)

  •    # channel filter co-efficients
       chan_filt_coeffs = optfir.low_pass (1,           # gain
                                           usrp_rate,   # sampling 
    

rate
80e3, # passband
cutoff
@@ -101,8 +108,22 @@ class wfm_rx_block (stdgui2.std_top_block):
#print len(chan_filt_coeffs)
chan_filt = gr.fir_filter_ccf (chanfilt_decim,
chan_filt_coeffs)

  •    # wide-band FM demodulator
       self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
    
  •    # rational resampler
    
  •    input_rate  = int(options.input_rate)       # 32050 Hz default
    
  •    #input_rate  = audio_rate                   # 32051 Hz as 
    

computed earlier (line 82), but hangs the application

  •    output_rate = int(options.output_rate)      # 48 kHz default
    
  •    interp = gru.lcm(input_rate, output_rate) / input_rate
    
  •    decim  = gru.lcm(input_rate, output_rate) / output_rate
    
  •    print "interp =", interp
    
  •    print "decim  =", decim
    
  •    rr = blks2.rational_resampler_fff(interp, decim)
    
  •    # volume control
       self.volume_control = gr.multiply_const_ff(self.vol)
    
       # sound card as final sink
    

@@ -111,7 +132,7 @@ class wfm_rx_block (stdgui2.std_top_block):
False) # ok_to_block

     # now wire it all together
  •    self.connect (self.u, chan_filt, self.guts, 
    

self.volume_control, audio_sink)

  •    self.connect (self.u, chan_filt, self.guts, rr, 
    

self.volume_control, audio_sink)

     self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)

Hi,

It sais, that the USRP digital downconverters have a programmable
decimation rate. What does this decimation rate do? Is this the filter
restricting the frequencies of the signal + noise?

And how do I change this decimation rate?

Thanks a lot for your help!

best,
Björn

Hi Alex,

On Jul 16, 2010, at 9:05 AM, Elvis D. wrote:

When I hard-code the value to 32050Hz, the system plays back, but at a slower speed.

In the previous patch, I missed setting the frequency of the audio sink
to the rational resampler’s output rate as shown in the patch snippet.
Once I replaced it, it playback worked at the correct frequency.

     # sound card as final sink
  •    audio_sink = audio.sink (int (audio_rate),
    
  •    audio_sink = audio.sink (int (output_rate),
    

Now, there are 2 outstanding issues:

a. If I stop and restart the application, the system becomes unstable,
and I get a bunch of audio under-runs.

b. If I use the computed audio rate, which according to the code below,
results in it being 32051 Hz, the system doesn’t launch

     audio_rate = demod_rate / audio_decimation  # ~32 kHz
  •    print "audio rate =", audio_rate
    

I get the following output, and the GUI doesn’t launch.

audio rate = 32051
Using RX d’board 0x0053

gr_fir_ccf: using SSE
gr_fir_fff: using SSE
interp = 48000
decim = 32051

If I hard code the values, and use the default options setting that I
just added, and use 32050 Hz, the application works. Why is that?

Best regards,

Elvis

PS: Here is the working patch, with the rational resampler after the WFM
demodulator. In this patch, the rational resampler’s audio input_rate is
set to 32050 Hz. Settting to to audio_rate computed from the WFM
demodulation block, results in 32051 Hz, which doesn’t work.

diff --git a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
index 1783660…8adb845 100755
— a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
+++ b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
@@ -51,7 +51,10 @@ class wfm_rx_block (stdgui2.std_top_block):
help=“set volume (default is midpoint)”)
parser.add_option("-O", “–audio-output”, type=“string”,
default="",
help=“pcm device name. E.g., hw:0,0 or
surround51 or /dev/dsp”)

  •    parser.add_option("-i", "--input-rate", type="eng_float", 
    

default=32050,

  •                      help="set input sample rate to RATE 
    

(%default)")

  •    parser.add_option("-o", "--output-rate", type="eng_float", 
    

default=48000,

  •                      help="set output sample rate to RATE 
    

(%default)")
(options, args) = parser.parse_args()
if len(args) != 0:
parser.print_help()
@@ -66,6 +69,7 @@ class wfm_rx_block (stdgui2.std_top_block):

     # build graph
  •    # USRP2 source
       self.u = usrp2.source_32fc(options.interface, options.mac_addr)
    
       adc_rate = self.u.adc_rate()                # 100 MS/s
    

@@ -76,6 +80,7 @@ class wfm_rx_block (stdgui2.std_top_block):
demod_rate = usrp_rate / chanfilt_decim
audio_decimation = 10
audio_rate = demod_rate / audio_decimation # ~32 kHz

  •    print "audio rate =", audio_rate
    
       #FIXME: need named constants and text descriptions available to 
    

(gr-)usrp2 even
#when usrp(1) module is not built. A usrp_common module,
perhaps?
@@ -87,11 +92,13 @@ class wfm_rx_block (stdgui2.std_top_block):
dbid == 0x0040 or #usrp_dbid.TV_RX_REV_3
dbid == 0x0043 or #usrp_dbid.TV_RX_MIMO
dbid == 0x0044 or #usrp_dbid.TV_RX_REV_2_MIMO

  •            dbid == 0x0045 ): #usrp_dbid.TV_RX_REV_3_MIMO
    
  •            dbid == 0x0045 or #usrp_dbid.TV_RX_REV_3_MIMO
    
  •            dbid == 0x0053 ): #usrp_dbid.WBX
           print "This daughterboard does not cover the required 
    

frequency range"
print “for this application. Please use a BasicRX or TVRX
daughterboard.”
raw_input(“Press ENTER to continue anyway, or Ctrl-C to
exit.”)

  •    # channel filter co-efficients
       chan_filt_coeffs = optfir.low_pass (1,           # gain
                                           usrp_rate,   # sampling 
    

rate
80e3, # passband
cutoff
@@ -101,17 +108,32 @@ class wfm_rx_block (stdgui2.std_top_block):
#print len(chan_filt_coeffs)
chan_filt = gr.fir_filter_ccf (chanfilt_decim,
chan_filt_coeffs)

  •    # wide-band FM demodulator
       self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
    
  •    # rational resampler
    
  •    input_rate  = int(options.input_rate)       # 32050 Hz default
    
  •    #input_rate  = audio_rate                   # 32051 Hz as 
    

computed earlier (line 82), but hangs the application

  •    output_rate = int(options.output_rate)      # 48 kHz default
    
  •    interp = gru.lcm(input_rate, output_rate) / input_rate
    
  •    decim  = gru.lcm(input_rate, output_rate) / output_rate
    
  •    print "interp =", interp
    
  •    print "decim  =", decim
    
  •    rr = blks2.rational_resampler_fff(interp, decim)
    
  •    # volume control
       self.volume_control = gr.multiply_const_ff(self.vol)
    
       # sound card as final sink
    
  •    audio_sink = audio.sink (int (audio_rate),
    
  •    audio_sink = audio.sink (int (output_rate),
                                options.audio_output,
                                False)  # ok_to_block
    
       # now wire it all together
    
  •    self.connect (self.u, chan_filt, self.guts, 
    

self.volume_control, audio_sink)

  •    self.connect (self.u, chan_filt, self.guts, rr, 
    

self.volume_control, audio_sink)

  •    #self.connect (self.u, chan_filt, self.guts, 
    

self.volume_control, audio_sink)

     self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)

Hi Scott,

On Jul 16, 2010, at 7:52 PM, Scott Johnston wrote:

I have been following this thread because I am attempting to do the same thing. Can you tell me what the values for “interp” and “decim” are when the program is working correctly. Also, my system is failing to tune to the center frequency. Have you come across this problem, or do you have any solutions to it?

Join the club!! :slight_smile: This thing requires some heavy perseverance !!

So, if you apply the patch that I sent across earlier, and the rational
resampler input settings is at 32050, and the output rate setting is at
48000.

I have attached the full file below.

Hi Bryan,

On Jul 16, 2010, at 1:27 AM, Bryan Edelman wrote:

Hardcode audio_rate to 48000, set audio_decimate = 6, usrp_decim = 312, chanfilt_decim = 1.

Hard-coding these values worked! There was still a lot of static, but
the music sounded fine and was playing back at the correct
frequency/sample rate. There were no audio under-runs.

Ensure that the fm station is physically nearby so you have a nice strong signal. I get SSSSSSSS (seq num error) in the terminal but it sounds fine.

The FM station is a public FM station, so perhaps signal strength is an
issue. I’m using a 75cm long wire antenna connected to the RX port on
the WBX module.

Is there some way to improve signal reception, to that of let’s say car
audio FM systems, using the USRP2 + WBX combination?

There’s a signal attenuator and low-noise amp for the WBX RF front-end
module, shouldn’t that be sufficient to get clear broadcast FM radio?

Elvis D.

Hi Scott,

On Jul 16, 2010, at 7:52 PM, Scott Johnston wrote:

Hello Alex and Elvis,

I have been following this thread because I am attempting to do the same thing. Can you tell me what the values for “interp” and “decim” are when the program is working correctly.

I just reverted the images back to raw ethernet, the latest ones

u2_rev3-20100603.bin
txrx_wbx_raw_eth_20100608.bin

and executed the following command, and got the same results. The interp
and decim values are shown below. As you can see, its not working
correctly because of the audio buffer under-runs. It only worked once
correctly, without any modifications to the script, the rest of the time
it never worked.

$ ./usrp2_wfm_rr_rcv.py -e eth2 -f 104.1 -V 0.0 -g 31 -O hw:0,0
audio rate = 32051
Using RX d’board 0x0053

gr_fir_ccf: using SSE
gr_fir_fff: using SSE
interp = 960
decim = 641
aUaUaUaUSaUaUaUaUaUaUaUaUaUaUSaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaU

Best regards,

Elvis D.

Hi Alex,

On Jul 16, 2010, at 8:11 PM, Alexandru C. wrote:

Would be worth trying USRP2 decim = 400 which would give nice round
sample rate of 250k

Wow, that worked!! I’m getting a clean strong FM audio reception now.

Best regards,

Elvis D.

Hi Scott,

On Jul 16, 2010, at 8:37 PM, Scott Johnston wrote:

I just copied that code and ran it and I got a divide by zero error. It comes from

form.quantized_slider_field(parent=self.panel, sizer=hbox, label=“Gain”,
weight=3, range=self.u.gain_range(),
callback=self.set_gain)

range gets set to 0 and then somewhere in form.py it divides something by range to make the slider.
Any idea why this is happening? I know I can just assign a gain, but I think whatever is causing this problem may be causing me other problems.

Can you see if you get proper audio out, when you specify the gain as a
parameter:

$ ./usrp2_wfm_rr_rcv.py -e eth2 -f 104.1 -V 0.0 -g 31 -O hw:0,0

It would be useful to know if your WBX board (assuming that you’re also
using one) is working correctly, and if my board has some sort of
defect.

Best regards,

Elvis D.

Hi Alex,

On Jul 16, 2010, at 8:16 PM, Elvis D. wrote:

Wow, that worked!! I’m getting a clean strong FM audio reception now.

I think I spoke too soon, it worked once, and now its back to the
distorted audio

$ ./usrp2_wfm_rr_rcv.py -e eth2 -f 104.1 -V 0.0 -g 31 -O hw:0,0
audio rate = 25000
Using RX d’board 0x0053

gr_fir_ccf: using SSE
gr_fir_fff: using SSE
interp = 48
decim = 25
aUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaUaU

What could be causing this unpredictable performance? Is it because of
the WBX board overheating or something ?

It works 1 out of every 60 to 100 attempts.

Best regards,

Elvis D.

On Fri, Jul 16, 2010 at 2:30 AM, [email protected] wrote:

Hi,

It sais, that the USRP digital downconverters have a programmable decimation
rate. What does this decimation rate do? Is this the filter restricting the
frequencies of the signal + noise?

And how do I change this decimation rate?

Decimation reduces the sample rate of the incoming sequence to a lower
rate. You can find more information about the DDC on the wiki.

http://gnuradio.org/redmine/wiki/1/UsrpFAQDDC

How you set the decimation rate depends on how you use gnuradio. You
may want to look at the following usrp interface file.

usrp/host/include/usrp/usrp_standard.h

Thomas