Merged r6015:6026 from jcorgan/radar.
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 19 Jul 2007 04:39:37 +0000 (04:39 +0000)
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 19 Jul 2007 04:39:37 +0000 (04:39 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6027 221aa14e-8319-0410-a670-987f0aec2ac5

gr-radar-mono/README
gr-radar-mono/src/python/radar_mono.py
gr-radar-mono/src/python/usrp_radar_mono.py
gr-usrp/src/db_flexrf.py

index f449af8eb5cf2723480b9f3675121a2462814643..0ecf4e381ee0a506bf60db468f425c30ba75635d 100644 (file)
@@ -9,7 +9,7 @@ a range resolution of approximately 5 meters.
 
 Only boards in slot A are supported.
 
-The script to run is place in $prefix/bin:
+The script to run is placed in $prefix/bin:
 
 Usage: usrp_radar_mono.py [options]
 
@@ -32,7 +32,7 @@ Options:
   -v, --verbose         enable verbose output, default is disabled
   -D, --debug           enable debugging output, default is disabled
 
-The transmitter creates a LFM chirp, evenly centered on the supplied frequency.
+The transmitter creates an LFM chirp, evenly centered on the supplied frequency.
 The four timing parameters are:
 
 ton    Chirp on time in seconds.  
index 5a5be9c8db680e9abb72aa4dec88adeba54bb2f0..0f2c2b252abbe1ce174c3461be6b04724c5f286d 100644 (file)
@@ -69,6 +69,8 @@ class radar_tx:
         self._u = usrp.sink_s(fpga_filename='usrp_radar_mono.rbf')
         self._subdev_spec = (0,0); # FPGA code only implements side A
         self._subdev = usrp.selected_subdev(self._u, self._subdev_spec)
+       if hasattr(self._subdev, 'set_lo_offset'):
+           self._subdev.set_lo_offset(0)
        self._ton_ticks = 0
        self._tsw_ticks = 0
        self._tlook_ticks = 0
@@ -126,8 +128,10 @@ class radar_tx:
 
     def start(self):
         self._u.start()
-
+       self._subdev.set_enable(True)
+       
     def stop(self):
+       self._subdev.set_enable(False)
        self._u.stop()
        
 #-----------------------------------------------------------------------
index 47db53c26f4e851e4808d1461838691a83f6445b..a16a18a8eb1d20be76a9ca356534433e736726de 100755 (executable)
@@ -35,7 +35,7 @@ def main():
                       help="set transmitter center frequency to FREQ in Hz, default is %default", metavar="FREQ")
     parser.add_option("-w", "--chirp-width", type="eng_float", default=32e6,
                       help="set LFM chirp bandwidth in Hz, default is %default", metavar="FREQ")
-    parser.add_option("-a", "--amplitude", type="eng_float", default=100,
+    parser.add_option("-a", "--amplitude", type="eng_float", default=15,
                       help="set waveform amplitude in % full scale, default is %default,")
     parser.add_option("",   "--ton", type="eng_float", default=5e-6,
                      help="set pulse on period in seconds, default is %default,")
index 271b14728baf9d5c3100c83ff51c83a5dbd77425..045bc39bd824e4f3a817990ea4faa1268f6d67ab 100644 (file)
@@ -225,7 +225,7 @@ class flexrf_base_tx(flexrf_base):
         # power up the transmit side, but don't enable the mixer
         self._u._write_oe(self._which,(POWER_UP|RX_TXN|ENABLE), 0xffff)
         self._u.write_io(self._which, (self.power_on|RX_TXN), (POWER_UP|RX_TXN|ENABLE))
-        self.lo_offset = 4e6             # FIXME may want to be a function of d'board
+        self.lo_offset = 4e6 
 
     def __del__(self):
         #print "flexrf_base_tx.__del__"
@@ -275,7 +275,22 @@ class flexrf_base_tx(flexrf_base):
         """
         return self._set_pga(self._u.pga_max())
 
-
+    def set_lo_offset(self, offset):
+       """
+       Set amount by which LO is offset from requested tuning frequency.
+       
+       @param offset: offset in Hz
+       """
+       self.lo_offset = offset
+
+    def get_lo_offset(self):
+       """
+       Get amount by which LO is offset from requested tuning frequency.
+       
+       @returns Offset in Hz
+       """
+       return self.lo_offset
+       
 class flexrf_base_rx(flexrf_base):
     def __init__(self, usrp, which):
         """
@@ -293,7 +308,7 @@ class flexrf_base_rx(flexrf_base):
 
         self.bypass_adc_buffers(True)
 
-        self.lo_offset = -4e6             # FIXME may want to be a function of d'board
+        self.lo_offset = -4e6
 
     def __del__(self):
         # print "flexrf_base_rx.__del__"
@@ -346,6 +361,22 @@ class flexrf_base_rx(flexrf_base):
         return self._u.write_aux_dac(self._which, 0, int(dac_value)) and \
                self._set_pga(int(pga_gain))
 
+    def set_lo_offset(self, offset):
+       """
+       Set amount by which LO is offset from requested tuning frequency.
+       
+       @param offset: offset in Hz
+       """
+       self.lo_offset = offset
+
+    def get_lo_offset(self):
+       """
+       Get amount by which LO is offset from requested tuning frequency.
+       
+       @returns Offset in Hz
+       """
+       return self.lo_offset
+       
 
 # ----------------------------------------------------------------