discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Help with Simple Amplitude Modulation Exercise


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Help with Simple Amplitude Modulation Exercise
Date: Sun, 29 Mar 2009 13:48:06 -0400
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

Thomas,

Thanks for your clearly presented question. Answers embedded below.

Thomas wrote:
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)


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 = 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.


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






reply via email to

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