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", "--freq", type="eng_float", default=1e6,
33 help="set waveform frequency to FREQ [default=%default]")
34 parser.add_option ("-a", "--amplitude", type="eng_float", default=16e3,
35 help="set waveform amplitude to AMPLITUDE [default=%default]", metavar="AMPL")
37 parser.add_option("-i", "--interp", type="int", default=32,
38 help="assume fgpa interpolation rate is INTERP [default=%default]")
40 (options, args) = parser.parse_args ()
46 src0 = gr.sig_source_c(master_clock/options.interp,
52 c2s = gr.complex_to_interleaved_short()
54 stdout_sink = gr.file_descriptor_sink(gr.sizeof_short, 1)
56 self.connect(src0, c2s, stdout_sink)
59 if __name__ == '__main__':
62 except KeyboardInterrupt: