3 # Copyright 2007 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 from gnuradio import gr, eng_notation
20 from gnuradio.eng_option import eng_option
21 from optparse import OptionParser
26 class my_top_block(gr.top_block):
29 gr.top_block.__init__(self)
31 parser = OptionParser(option_class=eng_option)
32 parser.add_option("-f", "--freq1", type="eng_float", default=1e6,
33 help="set waveform frequency to FREQ [default=%default]")
34 parser.add_option("-g", "--freq2", type="eng_float", default=1e6,
35 help="set waveform frequency to FREQ [default=%default]")
36 parser.add_option ("-a", "--amplitude1", type="eng_float", default=16e3,
37 help="set waveform amplitude to AMPLITUDE [default=%default]", metavar="AMPL")
38 parser.add_option ("-b", "--amplitude2", type="eng_float", default=16e3,
39 help="set waveform amplitude to AMPLITUDE [default=%default]", metavar="AMPL")
41 parser.add_option("-i", "--interp", type="int", default=32,
42 help="assume fgpa interpolation rate is INTERP [default=%default]")
44 (options, args) = parser.parse_args ()
50 src0 = gr.sig_source_c(master_clock/options.interp,
54 src1 = gr.sig_source_c(master_clock/options.interp,
62 c2s = gr.complex_to_interleaved_short()
64 stdout_sink = gr.file_descriptor_sink(gr.sizeof_short, 1)
66 self.connect(src0, (adder,0))
67 self.connect(src1, (adder,1))
68 self.connect(adder, c2s, stdout_sink)
71 if __name__ == '__main__':
74 except KeyboardInterrupt: