commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r4593 - gnuradio/branches/developers/jcorgan/dect/gnur


From: jcorgan
Subject: [Commit-gnuradio] r4593 - gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect
Date: Thu, 22 Feb 2007 10:22:02 -0700 (MST)

Author: jcorgan
Date: 2007-02-22 10:22:01 -0700 (Thu, 22 Feb 2007)
New Revision: 4593

Modified:
   
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/dect_receiver.py
   
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/usrp_source.py
Log:
Work in progress.

Modified: 
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/dect_receiver.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/dect_receiver.py
    2007-02-22 17:06:51 UTC (rev 4592)
+++ 
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/dect_receiver.py
    2007-02-22 17:22:01 UTC (rev 4593)
@@ -55,7 +55,7 @@
                                     if_rate,          # Sample rate
                                     _dect_occupied_bandwidth/2, # One sided 
modulation bandwidth
                                     _dect_channel_bandwidth/2,  # One sided 
channel bandwidth
-                                    0.1,              # Passband ripple (db)
+                                    1.0,              # Passband ripple (db)
                                     60)               # Stopband attenuation 
(db)
         if self._options.verbose:
             print "Channel filter has", len(chan_taps), "taps"

Modified: 
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/usrp_source.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/usrp_source.py
      2007-02-22 17:06:51 UTC (rev 4592)
+++ 
gnuradio/branches/developers/jcorgan/dect/gnuradio-examples/python/dect/usrp_source.py
      2007-02-22 17:22:01 UTC (rev 4593)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2004,2005,2007 Free Software Foundation, Inc.
+# Copyright 2007 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -29,18 +29,11 @@
 class usrp_source_c(gr.hier_block2):
     """
     Create a USRP source object supplying complex floats.
-    
-    Selects user supplied subdevice or chooses first available one.
-
-    Calibration value is the offset from the tuned frequency to 
-    the actual frequency.       
     """
-    def __init__(self, fg, which=0, subdev_spec=None, decim=None,
-                 if_rate=None, gain=None, freq=None, calibration=None,
-                 verbose=False):
+    def __init__(self, which=0, subdev_spec=None, gain=None, if_rate=None,
+                 freq=0.0, calibration=0.0, verbose=False):
        # Call hierarchical block constructor
-       # Top-level blocks have no inputs or outputs
-       gr.hier_block2.__init__(self, 
+       gr.hier_block2.__init__(self,
                                 "usrp_source_c",                           # 
Block typename
                                gr.io_signature(0,0,0),                    # 
Input signature
                                gr.io_signature(1,1,gr.sizeof_gr_complex)) # 
Output signature
@@ -52,7 +45,7 @@
         self.set_subdev(subdev_spec)
         self.set_if_rate(if_rate)
         self.set_gain(gain)
-        self.set_calibration(gain)
+        self.set_calibration(calibration)
         self.tune(freq)
 
         self.define_component("usrp", self._u)
@@ -64,7 +57,7 @@
         self._subdev = usrp.selected_subdev(self._u, subdev_spec)
         self._u.set_mux(usrp.determine_rx_mux_value(self._u, subdev_spec))
         if self._verbose:
-            print 'Using', self._subdev.name(), 'daughterboard'
+            print 'RX using', self._subdev.name(), 'daughterboard'
             
     def pick_subdevice(self):
         """
@@ -83,12 +76,12 @@
         # If no IF rate specified, set to maximum decimation
         if if_rate is None:
             self._decim = 256
-            self._if_rate = self._u.adc_rate()/self._decim
         else:
-            self._if_rate = if_rate
-            self._decim = int(self._u.adc_rate()/self._if_rate)
+            self._decim = int(self._u.adc_rate()/if_rate)
 
         self._u.set_decim_rate(self._decim)
+        self._if_rate = self._u.adc_rate()/self._decim
+
         if self._verbose:
             print "USRP decimation rate is", self._decim
             print "USRP IF rate is", n2s(self._if_rate), "sps"
@@ -102,8 +95,6 @@
         self._subdev.set_gain(self._gain)
 
     def set_calibration(self, calibration):
-        if calibration is None:
-            calibration = 0.0
         self._cal = calibration
         if self._verbose:
             print "Using frequency calibration offset of", n2s(calibration), 
"Hz"
@@ -131,3 +122,5 @@
         
         return False
 
+if __name__ == '__main__':
+    src = usrp_source_c(verbose=True)





reply via email to

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