diff options
author | trondeau | 2009-02-28 04:15:05 +0000 |
---|---|---|
committer | trondeau | 2009-02-28 04:15:05 +0000 |
commit | c57b705cf907ad3329da629f9d4dbbd82dc53c08 (patch) | |
tree | 6efa03e5c510a723832ada88caf6f5467321c70e /gr-qtgui/src/python | |
parent | 916a20271b7d81edc40dfc18468634311172c952 (diff) | |
download | gnuradio-c57b705cf907ad3329da629f9d4dbbd82dc53c08.tar.gz gnuradio-c57b705cf907ad3329da629f9d4dbbd82dc53c08.tar.bz2 gnuradio-c57b705cf907ad3329da629f9d4dbbd82dc53c08.zip |
Adding a constellation plot and an example for viewing constellations of digital modulations.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10537 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-qtgui/src/python')
-rwxr-xr-x | gr-qtgui/src/python/qt_digital.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gr-qtgui/src/python/qt_digital.py b/gr-qtgui/src/python/qt_digital.py new file mode 100755 index 000000000..f7635b4a5 --- /dev/null +++ b/gr-qtgui/src/python/qt_digital.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +from gnuradio import gr, blks2 +from gnuradio.qtgui import qtgui +import scipy + +class my_top_block(gr.top_block): + def __init__(self): + gr.top_block.__init__(self) + + sps = 2 + excess_bw = 0.35 + gray_code = True + + fftsize = 2048 + + data = scipy.random.randint(0, 255, 1000) + src = gr.vector_source_b(data, True) + mod = blks2.dqpsk_mod(sps, excess_bw, gray_code, False, False) + + rrctaps = gr.firdes.root_raised_cosine(1, sps, 1, excess_bw, 21) + rx_rrc = gr.fir_filter_ccf(sps, rrctaps) + + thr = gr.throttle(gr.sizeof_gr_complex, 10*fftsize) + self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -1/2, 1/2) + self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -1/2, 1/2) + + self.connect(src, mod, self.snk_tx) + self.connect(mod, rx_rrc, thr, self.snk_rx) + + self.snk_tx.initialize() + qapp = self.snk_tx.get_qapplication() + self.snk_rx.initialize(qapp) + +if __name__ == "__main__": + tb = my_top_block(); + tb.start() + tb.snk_tx.start_app(); + #tb.wait(); + |