commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10641 - gnuradio/branches/developers/eb/t348/usrp/hos


From: eb
Subject: [Commit-gnuradio] r10641 - gnuradio/branches/developers/eb/t348/usrp/host/apps
Date: Wed, 18 Mar 2009 23:20:04 -0600 (MDT)

Author: eb
Date: 2009-03-18 23:20:04 -0600 (Wed, 18 Mar 2009)
New Revision: 10641

Modified:
   gnuradio/branches/developers/eb/t348/usrp/host/apps/test_usrp_standard_tx.cc
Log:
Supply a default freq in order to have it behave closer to how it used to.


Modified: 
gnuradio/branches/developers/eb/t348/usrp/host/apps/test_usrp_standard_tx.cc
===================================================================
--- 
gnuradio/branches/developers/eb/t348/usrp/host/apps/test_usrp_standard_tx.cc    
    2009-03-19 04:50:05 UTC (rev 10640)
+++ 
gnuradio/branches/developers/eb/t348/usrp/host/apps/test_usrp_standard_tx.cc    
    2009-03-19 05:20:04 UTC (rev 10641)
@@ -172,7 +172,7 @@
   int which = 0;                       // specify which USRP board
   usrp_subdev_spec spec(0,0);          // specify the d'board side
   int interp = 16;                     // set the interpolation rate
-  double rf_freq = 0;                  // set the frequency
+  double rf_freq = -1;                 // set the frequency
   float amp = 10000;                   // set the amplitude of the output
   float gain = -1;                     // set the d'board PGA gain
   int waveform;
@@ -211,14 +211,6 @@
     return 1;
   }
   
-  if(vm.count("rf-freq")) {
-    rf_freq = vm["rf-freq"].as<double>();
-  }
-
-  if(vm.count("nsamples")) {
-    nsamples = vm["nsamples"].as<double>();
-  }
-
   if(vm.count("tx-subdev-spec")) {
     std::string s = vm["tx-subdev-spec"].as<std::string>();
     spec = str_to_subdev(s);
@@ -268,16 +260,17 @@
   printf("mux: %#08x\n",  mux);
   utx->set_mux(mux);
 
-  if(gain == -1) {
+  if(gain == -1)
     gain = subdev->gain_max();
-  }
   subdev->set_gain(gain);
 
-
   float input_rate = utx->dac_rate() / utx->interp_rate();
   printf("baseband rate: %g\n",  input_rate);
 
   usrp_tune_result r;
+
+  if (rf_freq < 0)
+    rf_freq = (subdev->freq_min() + subdev->freq_max()) * 0.5;
   double target_freq = rf_freq;
   bool ok = utx->tune(subdev->which(), subdev, target_freq, &r);
 





reply via email to

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