[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] gnuradio-examples/python/usrp fsk_loopback.py f...
From: |
Eric Blossom |
Subject: |
[Commit-gnuradio] gnuradio-examples/python/usrp fsk_loopback.py f... |
Date: |
Wed, 21 Jun 2006 21:30:57 +0000 |
CVSROOT: /sources/gnuradio
Module name: gnuradio-examples
Changes by: Eric Blossom <eb> 06/06/21 21:30:57
Removed files:
python/usrp : fsk_loopback.py fsk_rx.py fsk_tx.py
Log message:
removed obsolete, non-working code
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnuradio-examples/python/usrp/fsk_loopback.py?cvsroot=gnuradio&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnuradio-examples/python/usrp/fsk_rx.py?cvsroot=gnuradio&r1=1.7&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnuradio-examples/python/usrp/fsk_tx.py?cvsroot=gnuradio&r1=1.5&r2=0
Patches:
Index: fsk_loopback.py
===================================================================
RCS file: fsk_loopback.py
diff -N fsk_loopback.py
--- fsk_loopback.py 12 Jun 2005 16:28:31 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,127 +0,0 @@
-#!/usr/bin/env python
-
-from gnuradio import gr, eng_notation
-# from gnuradio import usrp
-from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import math
-
-from gnuradio.wxgui import stdgui, fftsink
-import wx
-
-
-class fsk_tx_graph (stdgui.gui_flow_graph):
- def __init__(self, frame, panel, vbox, argv):
- stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
-
- parser = OptionParser (option_class=eng_option)
- parser.add_option ("-c", "--cordic-freq", type="eng_float",
default=29.32e6,
- help="set Tx cordic frequency to FREQ",
metavar="FREQ")
- parser.add_option ("-f", "--filename", type="string",
- default="/home/eb/demo/payload.dat",
- help="read data from FILENAME")
- parser.add_option ("-R", "--repeat", action="store_true",
default=False)
- parser.add_option ("-r", "--data-rate", type="eng_float",
default=100e3)
- (options, args) = parser.parse_args ()
-
- print "cordic_freq = %s" % (eng_notation.num_to_str
(options.cordic_freq))
-
- # ----------------------------------------------------------------
-
- data_rate = options.data_rate
- self.sw_interp = 8
- self.usrp_interp = 128e6 / self.sw_interp / data_rate
- self.fs = 128e6 / self.usrp_interp
-
- max_deviation = data_rate / 4
- payload_size = 10 # bytes
-
- print "data_rate = ", data_rate
- print "sw_interp = ", self.sw_interp
- print "usrp_interp = ", self.usrp_interp
- print "fs = ", self.fs
-
- # transmitter pipeline
-
- src = gr.file_source (gr.sizeof_char, options.filename, options.repeat)
-
- framer = gr.simple_framer (payload_size)
-
- bytes_to_syms = gr.bytes_to_syms ()
-
-
- interp_taps = gr.firdes.low_pass (self.sw_interp, # gain
- self.fs, # sampling rate
- data_rate / 2 * 1.2, # cutoff
- data_rate/2 * 0.4, # trans width
- gr.firdes.WIN_HANN)
-
- print "len = ", len (interp_taps)
-
- interp = gr.interp_fir_filter_fff (self.sw_interp, interp_taps)
-
- k = 2 * math.pi * max_deviation / self.fs
- fmmod = gr.frequency_modulator_fc (k)
-
- gain = gr.multiply_const_cc (2000)
-
- self.connect (src, framer)
- self.connect (framer, bytes_to_syms)
- self.connect (bytes_to_syms, interp)
- self.connect (interp, fmmod)
- self.connect (fmmod, gain)
- tx_tail = gain # end of tx pipeline
-
-
- if 0:
- post_interp = fftsink.fft_sink_f (self, panel, title="Post
Interp", fft_size=512, sample_rate=self.fs)
- self.connect (interp, post_interp)
- vbox.Add (post_interp.win, 1, wx.EXPAND)
-
- if 0:
- post_mod = fftsink.fft_sink_c (self, panel, title="Post
Modulation", fft_size=512, sample_rate=self.fs)
- self.connect (fmmod, post_mod)
- vbox.Add (post_mod.win, 1, wx.EXPAND)
-
- # receiver pipeline
-
- self.samples_per_symbol = 8
- self.usrp_decim = 64e6 / self.samples_per_symbol / data_rate
- assert (self.fs == data_rate * self.samples_per_symbol)
-
- demod_gain = 1
- filter_taps = gr.firdes.low_pass (1, # gain
- self.fs, # sampling rate
- data_rate / 2 * 1.1, # cutoff
- data_rate, # trans width
- gr.firdes.WIN_HANN)
-
- print "len = ", len (filter_taps)
-
- filter = gr.fir_filter_ccf (1, filter_taps)
-
- # k = 2 * math.pi * max_deviation / self.fs
- fmdemod = gr.quadrature_demod_cf (demod_gain)
-
- corr = gr.simple_correlator (payload_size)
-
- filesink = gr.file_sink (gr.sizeof_char, "rx.dat")
-
- self.connect (tx_tail, filter)
- self.connect (filter, fmdemod)
- self.connect (fmdemod,corr)
- self.connect (corr,filesink)
-
- if 0:
- fft_input = fftsink.fft_sink_c (self, panel, "Input", 512, self.fs)
- self.connect (tx_tail, fft_input)
- vbox.Add (fft_input.win, 1, wx.EXPAND)
-
-
-def main ():
- app = stdgui.stdapp (fsk_tx_graph, "FSK Loopback")
- app.MainLoop ()
-
-if __name__ == '__main__':
- main ()
Index: fsk_rx.py
===================================================================
RCS file: fsk_rx.py
diff -N fsk_rx.py
--- fsk_rx.py 2 Nov 2005 00:30:18 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,108 +0,0 @@
-#!/usr/bin/env python
-
-#
-# FIXME Needs work
-#
-
-from gnuradio import gr, eng_notation
-from gnuradio import usrp
-from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import math
-
-from gnuradio.wxgui import stdgui, fftsink, scopesink
-import wx
-
-
-class fsk_rx_graph (stdgui.gui_flow_graph):
- def __init__(self, frame, panel, vbox, argv):
- stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
-
- parser = OptionParser (option_class=eng_option)
- parser.add_option ("-c", "--cordic-freq", type="eng_float",
default=29.32e6,
- help="set Tx cordic frequency to FREQ",
metavar="FREQ")
- parser.add_option ("-r", "--data-rate", type="eng_float",
default=100e3)
- parser.add_option ("-f", "--filename", type="string",
- default="rx.dat", help="write data to FILENAME")
- parser.add_option ("-g", "--gain", type="eng_float", default=0,
- help="set Rx PGA gain in dB [0,20]")
- parser.add_option ("-N", "--no-gui", action="store_true",
default=False)
-
- (options, args) = parser.parse_args ()
- print "cordic_freq = %s" % (eng_notation.num_to_str
(options.cordic_freq))
-
- # ----------------------------------------------------------------
-
- data_rate = options.data_rate
- self.samples_per_symbol = 8
- self.usrp_decim = int (64e6 / self.samples_per_symbol / data_rate)
- self.fs = data_rate * self.samples_per_symbol
- payload_size = 1024 # bytes
-
- print "data_rate = ", eng_notation.num_to_str(data_rate)
- print "samples_per_symbol = ", self.samples_per_symbol
- print "usrp_decim = ", self.usrp_decim
- print "fs = ", eng_notation.num_to_str(self.fs)
-
- max_deviation = data_rate / 4
-
- u = usrp.source_c (0, self.usrp_decim)
- u.set_rx_freq (0, -options.cordic_freq)
- u.set_pga(0, options.gain)
- u.set_pga(1, options.gain)
-
-
- filter_taps = gr.firdes.low_pass (1, # gain
- self.fs, # sampling rate
- data_rate / 2 * 1.1, # cutoff
- data_rate, # trans width
- gr.firdes.WIN_HANN)
-
- print "len = ", len (filter_taps)
-
- filter = gr.fir_filter_ccf (1, filter_taps)
-
- k = 1
- # k = 2 * math.pi * max_deviation / self.fs
- fmdemod = gr.quadrature_demod_cf (k)
-
- corr = gr.simple_correlator (payload_size)
-
- filesink = gr.file_sink (gr.sizeof_char, options.filename)
-
- self.connect (u, filter)
- self.connect (filter, fmdemod)
- self.connect (fmdemod,corr)
- self.connect (corr,filesink)
-
- if 1 and not(options.no_gui):
- fft_input = fftsink.fft_sink_c (self, panel, title="Input",
fft_size=512, sample_rate=self.fs)
- self.connect (u, fft_input)
- vbox.Add (fft_input.win, 1, wx.EXPAND)
-
- if 1 and not(options.no_gui):
- fft_filter = fftsink.fft_sink_c (self, panel, title="Post Channel
Selection", fft_size=512, sample_rate=self.fs)
- self.connect (filter, fft_filter)
- vbox.Add (fft_filter.win, 1, wx.EXPAND)
-
- if 0 and not(options.no_gui):
- scope_input = scopesink.scope_sink_f (self, panel, title="Input",
sample_rate=self.fs)
- c2f = gr.complex_to_float()
- self.connect (u, c2f)
- self.connect ((c2f, 0), (scope_input,0))
- self.connect ((c2f, 1), (scope_input,1))
- vbox.Add (scope_input.win, 1, wx.EXPAND)
-
- if 0:
- post_mod = fftsink.fft_sink_c (self, panel, title="Post
Modulation", fft_size=512, sample_rate=self.fs)
- self.connect (sum, post_mod)
- vbox.Add (post_mod.win, 1, wx.EXPAND)
-
-
-def main ():
- app = stdgui.stdapp (fsk_rx_graph, "FSK Rx")
- app.MainLoop ()
-
-if __name__ == '__main__':
- main ()
Index: fsk_tx.py
===================================================================
RCS file: fsk_tx.py
diff -N fsk_tx.py
--- fsk_tx.py 2 Nov 2005 00:30:18 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,118 +0,0 @@
-#!/usr/bin/env python
-
-#
-# FIXME Needs work
-#
-
-from gnuradio import gr, eng_notation, optfir
-from gnuradio import usrp
-from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import math
-import sys
-
-from gnuradio.wxgui import stdgui, fftsink, scopesink
-import wx
-
-
-class fsk_tx_graph (stdgui.gui_flow_graph):
- def __init__(self, frame, panel, vbox, argv):
- stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
-
- usage="%prog: [options] file_to_transmit"
- parser = OptionParser (usage=usage, option_class=eng_option)
- parser.add_option ("-c", "--cordic-freq", type="eng_float",
default=29.32e6,
- help="set Tx cordic frequency to FREQ",
metavar="FREQ")
- parser.add_option ("-R", "--repeat", action="store_true",
default=False)
- parser.add_option ("-r", "--data-rate", type="eng_float",
default=100e3)
- parser.add_option ("-g", "--gain", type="eng_float", default=0,
- help="set Tx PGA gain in dB [-20, 0] (default=0)")
- parser.add_option ("-N", "--no-gui", action="store_true",
default=False)
- (options, args) = parser.parse_args ()
- if len(args) != 1:
- parser.print_help()
- sys.exit(1)
- filename = args[0]
-
-
- print "cordic_freq = %s" % (eng_notation.num_to_str
(options.cordic_freq))
-
- # ----------------------------------------------------------------
-
- data_rate = options.data_rate
- self.sw_interp = 8
- self.usrp_interp = int (128e6 / self.sw_interp / data_rate)
- self.fs = 128e6 / self.usrp_interp
-
- max_deviation = data_rate / 4
- payload_size = 1024 # bytes
-
- print "data_rate = ", eng_notation.num_to_str(data_rate)
- print "sw_interp = ", self.sw_interp
- print "usrp_interp = ", self.usrp_interp
- print "fs = ", eng_notation.num_to_str(self.fs)
-
- src = gr.file_source (gr.sizeof_char, filename, options.repeat)
-
- framer = gr.simple_framer (payload_size)
-
- bytes_to_syms = gr.bytes_to_syms ()
-
- if 1:
- interp_taps = gr.firdes.low_pass (self.sw_interp, # gain
- self.fs, # sampling
rate
- data_rate / 2 * 1.2, # cutoff
- data_rate/2 * 0.4, # trans
width
- gr.firdes.WIN_HANN)
- else:
- interp_taps = optfir.low_pass (self.sw_interp, # gain
- self.fs, # sampling rate
- data_rate/2 * 1.2, # passband
cutoff
- data_rate/2 * 1.6, # stopband
cutoff
- 0.1, #
passband ripple
- 70) # stopband
attenuation
-
- print "len = ", len (interp_taps)
-
- interp = gr.interp_fir_filter_fff (self.sw_interp, interp_taps)
-
- k = 2 * math.pi * max_deviation / self.fs
- fmmod = gr.frequency_modulator_fc (k)
-
- self.connect (src, framer, bytes_to_syms, interp, fmmod)
-
- gain = gr.multiply_const_cc (16000)
- u = usrp.sink_c (0, self.usrp_interp)
- u.set_tx_freq (0, options.cordic_freq)
- u.set_pga (0, options.gain)
- u.set_pga (1, options.gain)
-
- self.connect (fmmod, gain, u)
-
-
- if 1 and not(options.no_gui):
- post_interp = fftsink.fft_sink_f (self, panel, title="Post
Interp", fft_size=512, sample_rate=self.fs)
- self.connect (interp, post_interp)
- vbox.Add (post_interp.win, 1, wx.EXPAND)
-
- if 1 and not(options.no_gui):
- post_mod = fftsink.fft_sink_c (self, panel, title="Post
Modulation", fft_size=512, sample_rate=self.fs)
- self.connect (fmmod, post_mod)
- vbox.Add (post_mod.win, 1, wx.EXPAND)
-
- if 1 and not(options.no_gui):
- post_gain = scopesink.scope_sink_f(self, panel, title="Tx Data",
sample_rate=self.fs)
- c2f = gr.complex_to_float ()
- self.connect (gain, c2f)
- self.connect ((c2f, 0), (post_gain, 0))
- self.connect ((c2f, 1), (post_gain, 1))
- vbox.Add (post_gain.win, 1, wx.EXPAND)
-
-
-def main ():
- app = stdgui.stdapp (fsk_tx_graph, "FSK Tx")
- app.MainLoop ()
-
-if __name__ == '__main__':
- main ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] gnuradio-examples/python/usrp fsk_loopback.py f...,
Eric Blossom <=