Forum: GNU Radio Help with Simple Amplitude Modulation Exercise

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thomas (Guest)
on 2009-03-28 02:22
(Received via mailing list)
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

    
Tom R. (Guest)
on 2009-03-29 21:49
(Received via mailing list)
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
This topic is locked and can not be replied to.