Updated FSF address in all files. Fixes ticket:51
[debian/gnuradio] / gnuradio-examples / python / mc4020 / mc4020_fft.py
1 #!/usr/bin/env python
2 #
3 # Copyright 2004 Free Software Foundation, Inc.
4
5 # This file is part of GNU Radio
6
7 # GNU Radio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # GNU Radio is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Radio; see the file COPYING.  If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street,
20 # Boston, MA 02110-1301, USA.
21
22
23 from gnuradio import gr
24 from gnuradio import mc4020
25 from gnuradio.eng_option import eng_option
26 from gnuradio.wxgui import stdgui, fftsink
27 from optparse import OptionParser
28 import wx
29
30 class app_flow_graph (stdgui.gui_flow_graph):
31     def __init__(self, frame, panel, vbox, argv):
32         stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
33
34         
35         parser = OptionParser (option_class=eng_option)
36         (options, args) = parser.parse_args ()
37
38         input_rate = 20e6
39         src = mc4020.source (input_rate, mc4020.MCC_CH3_EN | mc4020.MCC_ALL_1V)
40         cvt = gr.short_to_float ()
41         block, fft_win = fftsink.make_fft_sink_f (self, panel, "Rx Data", 512, input_rate)
42
43         self.connect (src, cvt)
44         self.connect (cvt, block)
45         vbox.Add (fft_win, 1, wx.EXPAND)
46
47
48 def main ():
49     app = stdgui.stdapp (app_flow_graph, "USRP FFT")
50     app.MainLoop ()
51
52 if __name__ == '__main__':
53     main ()