Help with Simple Amplitude Modulation Exercise

Hi all,

I have been trying to get a simple DSB AM exercise working without
success. I’m sure I’m doing something fairly dumb, and I would really
appreciate any help you can offer.

I have two USRP’s, each connected to a separate computer in the same
room. Each USRP has an RFX1800 d’card installed. Using one USRP, I want
to modulate a 1.5 GHz carrier with a 150 Hz sinewave and transmit it as
DSB AM. I want to receive it with the other USRP, demodulate it, and
hear the 150 Hz tone. I am using the usrp_am_mw_rcv.py script to receive
the signal.

The following is my transmitter code. I’ve tried to keep it as simple as
possible.

#!/usr/bin/env python

from gnuradio import gr
from gnuradio import usrp

def build_graph ():

   dst = usrp.sink_c(0, 64)
  Â
   # set up the USRP
   subdev_spec = usrp.pick_tx_subdevice(dst)
   subdev = usrp.selected_subdev(dst, subdev_spec)
   dst.tune(subdev.which(), subdev, 1.5e9)
   subdev.set_gain(1000)
  Â
   # sampling frequency
   fs = 3000
  Â
   # 150 Hz tone source
   src1 = gr.sig_source_f (fs, gr.GR_SINE_WAVE, 150, 200, 1000)   Â

   f2c = gr.float_to_complex()

   fg = gr.top_block ()
  Â
   fg.connect (src1, f2c, dst)

   subdev.set_enable(True)  Â
  Â
   return fg

if name == ‘main’:
   fg = build_graph ()
   fg.start ()
   raw_input ('Press Enter to quit: ')
   fg.stop ()

The following is a link to a screenshot of the receiver.

http://img21.imageshack.us/img21/7355/rxpic.png

The audio spectrum doesn’t look right, and it doesn’t sound right
either. I get a continuous stream of “aUaUaU” at the terminal from which
I started the receiver script.

How am I messig it up?

Thank you!

Thomas

  Â

Thomas,

Thanks for your clearly presented question. Answers embedded below.

Thomas wrote:

and hear the 150 Hz tone. I am using the usrp_am_mw_rcv.py script to
def build_graph ():

dst = usrp.sink_c(0, 64)

# set up the USRP
subdev_spec = usrp.pick_tx_subdevice(dst)
subdev = usrp.selected_subdev(dst, subdev_spec)
dst.tune(subdev.which(), subdev, 1.5e9)
subdev.set_gain(1000)

This device doesn’t handle a 1000 dB gain. You can always ask the device
for its min/max gain values.

# sampling frequency
fs = 3000

The USRP is using an interpolation of 64, which means the transmit rate
is fs*64 = 128 Msps (the speed of the USRP DAC), so your fs should be
2e6 in this example. I’d recommend using a much higher interpolation
rate (it can go up to 512, so the fs is 250e3).

Make sure match the decimation rate at the receiver.

# 150 Hz tone source
src1 = gr.sig_source_f (fs, gr.GR_SINE_WAVE, 150, 200, 1000)     

f2c = gr.float_to_complex()

Why not just use the gr.sig_source_c instead of having both of these
blocks?

fg.start ()

You’re ALSA card is not handling the resampling rate that you have set
for it. I’m assuming the rate is 32 ksps and your card is probably
wanting to do 44.1 ksps. You will want to pass the script “-O
plughw:0,0”

How am I messig it up?

Thank you!

Thomas

Tom