[Top][All Lists]

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

[Discuss-gnuradio] USRP update

From: Eric Blossom
Subject: [Discuss-gnuradio] USRP update
Date: Thu, 25 Sep 2003 17:32:14 -0700
User-agent: Mutt/1.4.1i

I'm pleased to report that we're making good progress on the USRP.
We've worked around some annoying (and undocumented) bugs in the
Cypress FX2 USB controller, and are now able to get data from the
host, across the USB, through the FPGA digital up-converter and out
the D/A converters.

We're got simple python code that can do this from GNU Radio.
Now we're sorting out the input path.  We think it'll go quicker ;-)

As a preview of coming attractions, here's a small sample that does

#!/usr/bin/env python
# Copyright 2003 Free Software Foundation, Inc.
# This file is part of GNU Radio
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

# DSB AM transmitter using USRP

from GnuRadio import *

def build_graph (to_file):
    sample_rate = 125e6/(8 * 8 * 8)    # based on temporary hard coded FPGA 
    which_board = 0
    channel_bitmask = 0x1
    interp_rate = 512                  # currently ignored
    carrier_ampl = 10000
    station_freq = 1070e3              # ``1070 on your AM dial''

    fg = gr_FlowGraph ()

    # ``US Dial Tone'' 350 Hz + 440 Hz
    sig1 = VrSigSource_float (sample_rate, VR_SIN_WAVE, 350, 0.20)
    sig2 = VrSigSource_float (sample_rate, VR_SIN_WAVE, 440, 0.20)

    one = VrSigSource_float (sample_rate, VR_DC_WAVE, 0, 1.0)

    # sum = 1 + sig1 + sig2

    sum = GrAddFF ()
    fg.connect (sig1, sum)
    fg.connect (sig2, sum)
    fg.connect (one, sum)

    amp = VrAmpFF (carrier_ampl)
    fg.connect (sum, amp)
    if to_file:
        dst = GrFileSink (sizeof_float, "am_dsb.dat")
        fg.connect (amp, dst)
        f2c = GrFloatToComplex ()
        dst = GrUsrpSink (which_board, channel_bitmask, interp_rate)
        dst.set_tx_freq (0, station_freq)

        fg.connect (amp, f2c)
        fg.connect (f2c, dst)

    return fg

if __name__ == '__main__':
    to_file = False
    fg = build_graph (to_file)
    fg.start ()                           # fork thread(s) and return 
    # your GUI mail loop goes here...
    # fg.wait ();                         # wait (forever)
    raw_input ('Press Enter to quit: ')
    fg.stop ()

reply via email to

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