commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10126 - gnuradio/trunk/gr-utils/src/python


From: matt
Subject: [Commit-gnuradio] r10126 - gnuradio/trunk/gr-utils/src/python
Date: Thu, 18 Dec 2008 15:09:51 -0700 (MST)

Author: matt
Date: 2008-12-18 15:09:45 -0700 (Thu, 18 Dec 2008)
New Revision: 10126

Modified:
   gnuradio/trunk/gr-utils/src/python/usrp2_siggen.py
Log:
added frequency sweep capability


Modified: gnuradio/trunk/gr-utils/src/python/usrp2_siggen.py
===================================================================
--- gnuradio/trunk/gr-utils/src/python/usrp2_siggen.py  2008-12-17 23:02:59 UTC 
(rev 10125)
+++ gnuradio/trunk/gr-utils/src/python/usrp2_siggen.py  2008-12-18 22:09:45 UTC 
(rev 10126)
@@ -25,6 +25,7 @@
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
 import sys
+import math
 
 n2s = eng_notation.num_to_str
 
@@ -78,6 +79,19 @@
             self._src = gr.add_cc()
             self.connect(self._src1,(self._src,0))
             self.connect(self._src2,(self._src,1))
+        elif options.type == "sweep":
+            # rf freq is center frequency
+            # waveform_freq is total swept width
+            # waveform2_freq is sweep rate
+            #  will sweep from (rf_freq-waveform_freq/2) to 
(rf_freq+waveform_freq/2)
+            self._src1 = gr.sig_source_f(eth_rate,
+                                         gr.GR_TRI_WAVE,
+                                         options.waveform2_freq,
+                                         1.0,  # options.waveform_freq,
+                                         -0.5)
+            self._src2 = 
gr.frequency_modulator_fc(options.waveform_freq*2*math.pi/eth_rate)
+            self._src = gr.multiply_const_cc(options.amplitude)
+            self.connect(self._src1,self._src2,self._src)
         else:
             sys.stderr.write('Unknown waveform type\n')
             raise SystemExit, 1
@@ -139,6 +153,8 @@
                       help="generate Uniform random output")
     parser.add_option("--2tone", dest="type", action="store_const", 
const="2tone",
                       help="generate Two Tone signal for IMD testing")
+    parser.add_option("--sweep", dest="type", action="store_const", 
const="sweep",
+                      help="generate a swept sine wave")
                       
     (options, args) = parser.parse_args ()
     if len(args) != 0:





reply via email to

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