summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/examples
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-11-10 15:43:21 -0500
committerTom Rondeau <trondeau@vt.edu>2012-11-10 15:43:21 -0500
commit611f7e45e7a793f2489d76670a61493327838e3e (patch)
tree9c97a36fc0f5bdd8b6078fe110f330dde81a625d /gnuradio-core/src/examples
parent1155ff1e58fc3311f55f28d2e95f057708b99c7d (diff)
analog: fixing up GRC and other examples to use gr-analog for sig and noise sources.
Diffstat (limited to 'gnuradio-core/src/examples')
-rwxr-xr-xgnuradio-core/src/examples/network/dial_tone_source.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnuradio-core/src/examples/network/dial_tone_source.py b/gnuradio-core/src/examples/network/dial_tone_source.py
index 232a06de80..8c826e2ad4 100755
--- a/gnuradio-core/src/examples/network/dial_tone_source.py
+++ b/gnuradio-core/src/examples/network/dial_tone_source.py
@@ -23,14 +23,20 @@
from gnuradio import gr
from gnuradio.eng_option import eng_option
from optparse import OptionParser
+import sys
+
+try:
+ from gnuradio import analog
+except ImportError:
+ sys.stderr.write("This example required gr-analog.\n")
class dial_tone_source(gr.top_block):
def __init__(self, host, port, pkt_size, sample_rate, eof):
gr.top_block.__init__(self, "dial_tone_source")
amplitude = 0.3
- src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, amplitude)
- src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, amplitude)
+ src0 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 350, amplitude)
+ src1 = analog.sig_source_f(sample_rate, analog.GR_SIN_WAVE, 440, amplitude)
add = gr.add_ff()
# Throttle needed here to account for the other side's audio card sampling rate