diff options
Diffstat (limited to 'docs/exploring-gnuradio')
-rwxr-xr-x | docs/exploring-gnuradio/dial_tone.py | 25 | ||||
-rw-r--r-- | docs/exploring-gnuradio/dial_tone_example.xml | 21 | ||||
-rw-r--r-- | docs/exploring-gnuradio/exploring-gnuradio.xml | 2 |
3 files changed, 25 insertions, 23 deletions
diff --git a/docs/exploring-gnuradio/dial_tone.py b/docs/exploring-gnuradio/dial_tone.py index cabfa0864d..ba43c43bfc 100755 --- a/docs/exploring-gnuradio/dial_tone.py +++ b/docs/exploring-gnuradio/dial_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2007 Free Software Foundation, Inc. +# Copyright 2004,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -22,22 +22,23 @@ from gnuradio import gr from gnuradio import audio +from gnuradio import analog -def build_graph (): +def build_graph(): sampling_freq = 32000 ampl = 0.1 - tb = gr.top_block () - src0 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 440, ampl) - dst = audio.sink (sampling_freq) - tb.connect (src0, (dst, 0)) - tb.connect (src1, (dst, 1)) + tb = gr.top_block() + src0 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 440, ampl) + dst = audio.sink(sampling_freq) + tb.connect(src0, (dst, 0)) + tb.connect(src1, (dst, 1)) return tb if __name__ == '__main__': - tb = build_graph () - tb.start () - raw_input ('Press Enter to quit: ') - tb.stop () + tb = build_graph() + tb.start() + raw_input('Press Enter to quit: ') + tb.stop() diff --git a/docs/exploring-gnuradio/dial_tone_example.xml b/docs/exploring-gnuradio/dial_tone_example.xml index 14ea68039e..5d193df776 100644 --- a/docs/exploring-gnuradio/dial_tone_example.xml +++ b/docs/exploring-gnuradio/dial_tone_example.xml @@ -5,24 +5,25 @@ from gnuradio import gr from gnuradio import audio +from gnuradio import analog def build_graph (): sampling_freq = 48000 ampl = 0.1 - fg = gr.flow_graph () - src0 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 350, ampl) - src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 440, ampl) - dst = audio.sink (sampling_freq) - fg.connect ((src0, 0), (dst, 0)) - fg.connect ((src1, 0), (dst, 1)) + fg = gr.flow_graph() + src0 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 350, ampl) + src1 = analog.sig_source_f(sampling_freq, analog.GR_SIN_WAVE, 440, ampl) + dst = audio.sink(sampling_freq) + fg.connect((src0, 0), (dst, 0)) + fg.connect((src1, 0), (dst, 1)) return fg if __name__ == '__main__': - fg = build_graph () - fg.start () - raw_input ('Press Enter to quit: ') - fg.stop () + fg = build_graph() + fg.start() + raw_input('Press Enter to quit: ') + fg.stop() </programlisting> </example> diff --git a/docs/exploring-gnuradio/exploring-gnuradio.xml b/docs/exploring-gnuradio/exploring-gnuradio.xml index 286ca86095..5b70d4d0bf 100644 --- a/docs/exploring-gnuradio/exploring-gnuradio.xml +++ b/docs/exploring-gnuradio/exploring-gnuradio.xml @@ -180,7 +180,7 @@ right.</para> <para>We start by creating a flow graph to hold the blocks and connections between them. The two sine waves are generated by the -gr.sig_source_f calls. The f suffix indicates that the source produces +analog.sig_source_f calls. The f suffix indicates that the source produces floats. One sine wave is at 350 Hz, and the other is at 440 Hz. Together, they sound like the US dial tone.</para> |