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: Thomas
Subject: Re: [Discuss-gnuradio] Help with Simple Amplitude Modulation Exercise
Date: Tue, 31 Mar 2009 16:20:23 -0700 (PDT)



--- On Sun, 3/29/09, Tom Rondeau <address@hidden> wrote:

From: Tom Rondeau <address@hidden>
Subject: Re: [Discuss-gnuradio] Help with Simple Amplitude Modulation Exercise
To: "Thomas" <address@hidden>
Cc: address@hidden
Date: Sunday, March 29, 2009, 5:48 PM

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

Thank you so much, Tom, for your help. Your answers were very useful, and I was able to get it working.

You mentioned using a complex source. I tried that, but I got additional spikes in the audio spectrum at multiples of the 3 kHz tone I was transmitting. The following image shows what I mean.

http://img12.imageshack.us/img12/7129/screenshotusrpbroadcast.png

The next images shows the audio spectrum using the non-complex source.

http://img12.imageshack.us/img12/5867/screenshotusrpbroadcastj.png


I'm not sure why the spikes are only there when using the complex source. I'd like to know if anyone here knows.

Thanks!



reply via email to

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