diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72bd210 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +demod.dat +*.png diff --git a/demod.dat b/demod.dat deleted file mode 100644 index eb79d3b..0000000 Binary files a/demod.dat and /dev/null differ diff --git a/demod.py b/demod.py deleted file mode 100644 index 7d9901a..0000000 --- a/demod.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python3 - -import scipy.io.wavfile -from matplotlib import pyplot as plt -import numpy as np -from scipy.signal import decimate, hilbert - -MIX_FREQ = 1200.0 - -def render_waterfall(rate, chuck_period, samples): - period = 1/rate - print("Period is %s" % (period, )) - - chunk_size = int(chuck_period / period) - chunk_count = int(len(samples) / chunk_size) - - print("Chunk size: %d samples" % chunk_size) - print("Chunk count: %d" % chunk_count) - - ffts = [] - for i in range(0, chunk_count): - fft = np.fft.rfft(samples[i * chunk_size: (i+1) * chunk_size]) - fft = np.abs(fft) - fft /= len(fft) - fft = 20 * np.log10(fft) - ffts +=[fft] - - freqs = np.fft.rfftfreq(chunk_size, period) - - plt.viridis() - fig = plt.figure() - ax = fig.add_subplot(111) - cax = ax.matshow(ffts, aspect='auto', extent=(freqs[0], freqs[-1], chunk_count, 0)) - fig.colorbar(cax) - - plt.show() - - - -def main(): - rate, data = scipy.io.wavfile.read("satnogs_29407_2019-01-31T17-11-29_short.wav") - - render_waterfall(rate, 10 * 10**-3, data) - - phase_acc = np.arange(0, len(data)) - mix_sig = np.cos(phase_acc * 2 * np.pi * MIX_FREQ/rate) - data = data * mix_sig - - data = decimate(data, 20) - data = data - np.average(data) - data = data / np.max(np.abs(data)) - - render_waterfall(rate/20, 100 * 10**-3, data) - - cmplx = hilbert(data) - - phase = np.angle(cmplx) / np.pi - - dphase = phase[:-1] - phase[1:] - - plt.plot(dphase) - plt.show() - - -if __name__ == '__main__': - main() diff --git a/demod.wav b/demod.wav deleted file mode 100644 index 82ba0e2..0000000 Binary files a/demod.wav and /dev/null differ diff --git a/deriv.py b/deriv.py deleted file mode 100644 index 85161f3..0000000 --- a/deriv.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 - -import scipy.io.wavfile -from matplotlib import pyplot as plt -import numpy as np - -def main(): - rate, data = scipy.io.wavfile.read("demod.wav") - - data = data - np.average(data) - data = data / np.max(np.abs(data)) - - deriv = np.abs(data[1:] - data[0:-1]) - - plt.plot(deriv) - plt.show() - - - - - -if __name__ == '__main__': - main() diff --git a/output.png b/output.png deleted file mode 100644 index 362fa1f..0000000 Binary files a/output.png and /dev/null differ diff --git a/satnogs_29407_2019-01-31T17-11-29.ogg b/satnogs_29407_2019-01-31T17-11-29.ogg deleted file mode 100644 index cf471c6..0000000 Binary files a/satnogs_29407_2019-01-31T17-11-29.ogg and /dev/null differ diff --git a/satnogs_29407_2019-01-31T17-11-29.wav b/satnogs_29407_2019-01-31T17-11-29.wav deleted file mode 100644 index 653776b..0000000 Binary files a/satnogs_29407_2019-01-31T17-11-29.wav and /dev/null differ diff --git a/sstv_decode.grc b/sstv_decode.grc deleted file mode 100644 index 8911f38..0000000 --- a/sstv_decode.grc +++ /dev/null @@ -1,1463 +0,0 @@ - - - - Fri Feb 8 18:51:01 2019 - - options - - author - - - - window_size - - - - category - [GRC Hier Blocks] - - - comment - - - - description - - - - _enabled - True - - - _coordinate - (8, 8) - - - _rotation - 0 - - - generate_options - qt_gui - - - hier_block_src_path - .: - - - id - top_block - - - max_nouts - 0 - - - qt_qss_theme - - - - realtime_scheduling - - - - run_command - {python} -u {filename} - - - run_options - prompt - - - run - True - - - sizing_mode - fixed - - - thread_safe_setters - - - - title - - - - placement - (0,0) - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (7, 115) - - - _rotation - 0 - - - id - samp_rate - - - value - 48000 - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (7, 179) - - - _rotation - 0 - - - id - samp_rate_low - - - value - 4000 - - - - analog_sig_source_x - - amp - 1 - - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - freq - 1200 - - - _coordinate - (279, 91) - - - _rotation - 0 - - - id - analog_sig_source_x_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - offset - 0 - - - type - float - - - samp_rate - samp_rate - - - waveform - analog.GR_COS_WAVE - - - - blocks_multiply_xx - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - _coordinate - (502, 239) - - - _rotation - 0 - - - id - blocks_multiply_xx_0 - - - type - float - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - num_inputs - 2 - - - vlen - 1 - - - - blocks_throttle - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - _coordinate - (271, 267) - - - _rotation - 0 - - - id - blocks_throttle_0 - - - ignoretag - True - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - samples_per_second - samp_rate - - - type - float - - - vlen - 1 - - - - blocks_wavfile_sink - - bits_per_sample - 8 - - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - file - /home/sebastian/projects/satnogs/sstv/demod.wav - - - _coordinate - (1092, 649) - - - _rotation - 0 - - - id - blocks_wavfile_sink_0 - - - nchan - 1 - - - samp_rate - samp_rate_low - - - - blocks_wavfile_source - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - file - /home/sebastian/projects/satnogs/sstv/satnogs_29407_2019-01-31T17-11-29_short.wav - - - _coordinate - (55, 259) - - - _rotation - 0 - - - id - blocks_wavfile_source_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - nchan - 1 - - - repeat - False - - - - fir_filter_xxx - - alias - - - - comment - - - - affinity - - - - decim - 1 - - - _enabled - True - - - _coordinate - (845, 562) - - - _rotation - 0 - - - id - fir_filter_xxx_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - samp_delay - 0 - - - taps - [1, -1] - - - type - fff - - - - low_pass_filter - - beta - 6.76 - - - alias - - - - comment - - - - affinity - - - - cutoff_freq - 1100 - - - decim - 12 - - - _enabled - True - - - type - fir_filter_fff - - - _coordinate - (342, 522) - - - _rotation - 0 - - - gain - 1 - - - id - low_pass_filter_0 - - - interp - 1 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - samp_rate - samp_rate - - - width - 100 - - - win - firdes.WIN_HAMMING - - - - qtgui_time_sink_x - - autoscale - False - - - axislabels - True - - - alias - - - - comment - - - - ctrlpanel - False - - - affinity - - - - entags - True - - - _enabled - True - - - _coordinate - (1092, 554) - - - gui_hint - - - - _rotation - 0 - - - grid - False - - - id - qtgui_time_sink_x_0 - - - legend - True - - - alpha1 - 1.0 - - - color1 - "blue" - - - label1 - - - - marker1 - -1 - - - style1 - 1 - - - width1 - 1 - - - alpha10 - 1.0 - - - color10 - "blue" - - - label10 - - - - marker10 - -1 - - - style10 - 1 - - - width10 - 1 - - - alpha2 - 1.0 - - - color2 - "red" - - - label2 - - - - marker2 - -1 - - - style2 - 1 - - - width2 - 1 - - - alpha3 - 1.0 - - - color3 - "green" - - - label3 - - - - marker3 - -1 - - - style3 - 1 - - - width3 - 1 - - - alpha4 - 1.0 - - - color4 - "black" - - - label4 - - - - marker4 - -1 - - - style4 - 1 - - - width4 - 1 - - - alpha5 - 1.0 - - - color5 - "cyan" - - - label5 - - - - marker5 - -1 - - - style5 - 1 - - - width5 - 1 - - - alpha6 - 1.0 - - - color6 - "magenta" - - - label6 - - - - marker6 - -1 - - - style6 - 1 - - - width6 - 1 - - - alpha7 - 1.0 - - - color7 - "yellow" - - - label7 - - - - marker7 - -1 - - - style7 - 1 - - - width7 - 1 - - - alpha8 - 1.0 - - - color8 - "dark red" - - - label8 - - - - marker8 - -1 - - - style8 - 1 - - - width8 - 1 - - - alpha9 - 1.0 - - - color9 - "dark green" - - - label9 - - - - marker9 - -1 - - - style9 - 1 - - - width9 - 1 - - - name - "" - - - nconnections - 1 - - - size - 4096 - - - srate - samp_rate_low - - - stemplot - False - - - tr_chan - 0 - - - tr_delay - 0 - - - tr_level - 0.0 - - - tr_mode - qtgui.TRIG_MODE_FREE - - - tr_slope - qtgui.TRIG_SLOPE_POS - - - tr_tag - "" - - - type - float - - - update_time - 0.01 - - - ylabel - Amplitude - - - yunit - "" - - - ymax - 1 - - - ymin - -1 - - - - qtgui_waterfall_sink_x - - axislabels - True - - - bw - samp_rate_low - - - alias - - - - fc - 0 - - - comment - - - - affinity - - - - _enabled - True - - - fftsize - 1024 - - - _coordinate - (598, 466) - - - gui_hint - - - - _rotation - 0 - - - grid - False - - - id - qtgui_waterfall_sink_x_0 - - - int_max - 10 - - - int_min - -140 - - - legend - True - - - alpha1 - 1.0 - - - color1 - 3 - - - label1 - - - - alpha10 - 1.0 - - - color10 - 0 - - - label10 - - - - alpha2 - 1.0 - - - color2 - 0 - - - label2 - - - - alpha3 - 1.0 - - - color3 - 0 - - - label3 - - - - alpha4 - 1.0 - - - color4 - 0 - - - label4 - - - - alpha5 - 1.0 - - - color5 - 0 - - - label5 - - - - alpha6 - 1.0 - - - color6 - 0 - - - label6 - - - - alpha7 - 1.0 - - - color7 - 0 - - - label7 - - - - alpha8 - 1.0 - - - color8 - 0 - - - label8 - - - - alpha9 - 1.0 - - - color9 - 0 - - - label9 - - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - name - "" - - - nconnections - 1 - - - showports - True - - - freqhalf - False - - - type - float - - - update_time - 0.10 - - - wintype - firdes.WIN_BLACKMAN_hARRIS - - - - qtgui_waterfall_sink_x - - axislabels - True - - - bw - samp_rate_low - - - alias - - - - fc - 0 - - - comment - - - - affinity - - - - _enabled - True - - - fftsize - 1024 - - - _coordinate - (1092, 458) - - - gui_hint - - - - _rotation - 0 - - - grid - False - - - id - qtgui_waterfall_sink_x_0_0 - - - int_max - 10 - - - int_min - -140 - - - legend - True - - - alpha1 - 1.0 - - - color1 - 3 - - - label1 - - - - alpha10 - 1.0 - - - color10 - 0 - - - label10 - - - - alpha2 - 1.0 - - - color2 - 0 - - - label2 - - - - alpha3 - 1.0 - - - color3 - 0 - - - label3 - - - - alpha4 - 1.0 - - - color4 - 0 - - - label4 - - - - alpha5 - 1.0 - - - color5 - 0 - - - label5 - - - - alpha6 - 1.0 - - - color6 - 0 - - - label6 - - - - alpha7 - 1.0 - - - color7 - 0 - - - label7 - - - - alpha8 - 1.0 - - - color8 - 0 - - - label8 - - - - alpha9 - 1.0 - - - color9 - 0 - - - label9 - - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - name - "" - - - nconnections - 1 - - - showports - True - - - freqhalf - False - - - type - float - - - update_time - 0.10 - - - wintype - firdes.WIN_BLACKMAN_hARRIS - - - - satnogs_quad_demod_filter_ff - - alias - - - - comment - - - - affinity - - - - _enabled - True - - - _coordinate - (598, 562) - - - _rotation - 0 - - - gain - 1.0 - - - id - satnogs_quad_demod_filter_ff_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - win - 40 - - - - analog_sig_source_x_0 - blocks_multiply_xx_0 - 0 - 0 - - - blocks_multiply_xx_0 - low_pass_filter_0 - 0 - 0 - - - blocks_throttle_0 - blocks_multiply_xx_0 - 0 - 1 - - - blocks_wavfile_source_0 - blocks_throttle_0 - 0 - 0 - - - fir_filter_xxx_0 - blocks_wavfile_sink_0 - 0 - 0 - - - fir_filter_xxx_0 - qtgui_time_sink_x_0 - 0 - 0 - - - fir_filter_xxx_0 - qtgui_waterfall_sink_x_0_0 - 0 - 0 - - - low_pass_filter_0 - qtgui_waterfall_sink_x_0 - 0 - 0 - - - low_pass_filter_0 - satnogs_quad_demod_filter_ff_0 - 0 - 0 - - - satnogs_quad_demod_filter_ff_0 - fir_filter_xxx_0 - 0 - 0 - - diff --git a/sstv_decode2.grc b/sstv_demod.grc similarity index 100% rename from sstv_decode2.grc rename to sstv_demod.grc diff --git a/top_block.py b/top_block.py deleted file mode 100755 index e81309c..0000000 --- a/top_block.py +++ /dev/null @@ -1,260 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- -################################################## -# GNU Radio Python Flow Graph -# Title: Top Block -# Generated: Sat Feb 16 20:51:50 2019 -################################################## - -if __name__ == '__main__': - import ctypes - import sys - if sys.platform.startswith('linux'): - try: - x11 = ctypes.cdll.LoadLibrary('libX11.so') - x11.XInitThreads() - except: - print "Warning: failed to XInitThreads()" - -from PyQt4 import Qt -from gnuradio import analog -from gnuradio import blocks -from gnuradio import eng_notation -from gnuradio import filter -from gnuradio import gr -from gnuradio import qtgui -from gnuradio.eng_option import eng_option -from gnuradio.filter import firdes -from optparse import OptionParser -import sip -import sys -from gnuradio import qtgui - - -class top_block(gr.top_block, Qt.QWidget): - - def __init__(self): - gr.top_block.__init__(self, "Top Block") - Qt.QWidget.__init__(self) - self.setWindowTitle("Top Block") - qtgui.util.check_set_qss() - try: - self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) - except: - pass - self.top_scroll_layout = Qt.QVBoxLayout() - self.setLayout(self.top_scroll_layout) - self.top_scroll = Qt.QScrollArea() - self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) - self.top_scroll_layout.addWidget(self.top_scroll) - self.top_scroll.setWidgetResizable(True) - self.top_widget = Qt.QWidget() - self.top_scroll.setWidget(self.top_widget) - self.top_layout = Qt.QVBoxLayout(self.top_widget) - self.top_grid_layout = Qt.QGridLayout() - self.top_layout.addLayout(self.top_grid_layout) - - self.settings = Qt.QSettings("GNU Radio", "top_block") - self.restoreGeometry(self.settings.value("geometry").toByteArray()) - - - ################################################## - # Variables - ################################################## - self.samp_rate = samp_rate = 48000 - - ################################################## - # Blocks - ################################################## - self.rational_resampler_xxx_0 = filter.rational_resampler_fff( - interpolation=5263, - decimation=12000, - taps=None, - fractional_bw=None, - ) - self.qtgui_waterfall_sink_x_0_0 = qtgui.waterfall_sink_f( - 4096, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - 5263, #bw - "", #name - 1 #number of inputs - ) - self.qtgui_waterfall_sink_x_0_0.set_update_time(0.10) - self.qtgui_waterfall_sink_x_0_0.enable_grid(False) - self.qtgui_waterfall_sink_x_0_0.enable_axis_labels(True) - - if not True: - self.qtgui_waterfall_sink_x_0_0.disable_legend() - - if "float" == "float" or "float" == "msg_float": - self.qtgui_waterfall_sink_x_0_0.set_plot_pos_half(not True) - - labels = ['', '', '', '', '', - '', '', '', '', ''] - colors = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - alphas = [1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0] - for i in xrange(1): - if len(labels[i]) == 0: - self.qtgui_waterfall_sink_x_0_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_waterfall_sink_x_0_0.set_line_label(i, labels[i]) - self.qtgui_waterfall_sink_x_0_0.set_color_map(i, colors[i]) - self.qtgui_waterfall_sink_x_0_0.set_line_alpha(i, alphas[i]) - - self.qtgui_waterfall_sink_x_0_0.set_intensity_range(-140, 10) - - self._qtgui_waterfall_sink_x_0_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0_0.pyqwidget(), Qt.QWidget) - self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_0_0_win) - self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( - 4096, #size - firdes.WIN_BLACKMAN_hARRIS, #wintype - 0, #fc - samp_rate, #bw - "", #name - 1 #number of inputs - ) - self.qtgui_waterfall_sink_x_0.set_update_time(0.10) - self.qtgui_waterfall_sink_x_0.enable_grid(False) - self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) - - if not True: - self.qtgui_waterfall_sink_x_0.disable_legend() - - if "complex" == "float" or "complex" == "msg_float": - self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True) - - labels = ['', '', '', '', '', - '', '', '', '', ''] - colors = [0, 0, 0, 0, 0, - 0, 0, 0, 0, 0] - alphas = [1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0] - for i in xrange(1): - if len(labels[i]) == 0: - self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) - self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) - self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) - - self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) - - self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) - self.top_grid_layout.addWidget(self._qtgui_waterfall_sink_x_0_win) - self.qtgui_time_sink_x_0 = qtgui.time_sink_f( - 1024, #size - 5263, #samp_rate - "", #name - 1 #number of inputs - ) - self.qtgui_time_sink_x_0.set_update_time(0.10) - self.qtgui_time_sink_x_0.set_y_axis(-3.2, 3.2) - - self.qtgui_time_sink_x_0.set_y_label('Amplitude', "") - - self.qtgui_time_sink_x_0.enable_tags(-1, True) - self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") - self.qtgui_time_sink_x_0.enable_autoscale(False) - self.qtgui_time_sink_x_0.enable_grid(False) - self.qtgui_time_sink_x_0.enable_axis_labels(True) - self.qtgui_time_sink_x_0.enable_control_panel(False) - self.qtgui_time_sink_x_0.enable_stem_plot(False) - - if not True: - self.qtgui_time_sink_x_0.disable_legend() - - labels = ['', '', '', '', '', - '', '', '', '', ''] - widths = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - colors = ["blue", "red", "green", "black", "cyan", - "magenta", "yellow", "dark red", "dark green", "blue"] - styles = [1, 1, 1, 1, 1, - 1, 1, 1, 1, 1] - markers = [-1, -1, -1, -1, -1, - -1, -1, -1, -1, -1] - alphas = [1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0] - - for i in xrange(1): - if len(labels[i]) == 0: - self.qtgui_time_sink_x_0.set_line_label(i, "Data {0}".format(i)) - else: - self.qtgui_time_sink_x_0.set_line_label(i, labels[i]) - self.qtgui_time_sink_x_0.set_line_width(i, widths[i]) - self.qtgui_time_sink_x_0.set_line_color(i, colors[i]) - self.qtgui_time_sink_x_0.set_line_style(i, styles[i]) - self.qtgui_time_sink_x_0.set_line_marker(i, markers[i]) - self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i]) - - self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget) - self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win) - self.low_pass_filter_0 = filter.fir_filter_fff(1, firdes.low_pass( - 1, 12000, 1000, 1000, firdes.WIN_HAMMING, 6.76)) - self.hilbert_fc_0 = filter.hilbert_fc(65, firdes.WIN_HAMMING, 6.76) - self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(4, (127, ), 1750, samp_rate) - self.blocks_wavfile_source_0 = blocks.wavfile_source('/home/sebastian/projects/satnogs/sstv/satnogs_29412_2019-02-01T16-20-03_short.wav', False) - self.blocks_throttle_0 = blocks.throttle(gr.sizeof_float*1, samp_rate,True) - self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_float*1, 'demod.dat', False) - self.blocks_file_sink_0.set_unbuffered(False) - self.analog_nbfm_rx_0 = analog.nbfm_rx( - audio_rate=samp_rate/4, - quad_rate=samp_rate/4, - tau=75e-6, - max_dev=600, - ) - - - - ################################################## - # Connections - ################################################## - self.connect((self.analog_nbfm_rx_0, 0), (self.low_pass_filter_0, 0)) - self.connect((self.blocks_throttle_0, 0), (self.hilbert_fc_0, 0)) - self.connect((self.blocks_wavfile_source_0, 0), (self.blocks_throttle_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.analog_nbfm_rx_0, 0)) - self.connect((self.hilbert_fc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) - self.connect((self.hilbert_fc_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) - self.connect((self.low_pass_filter_0, 0), (self.rational_resampler_xxx_0, 0)) - self.connect((self.rational_resampler_xxx_0, 0), (self.blocks_file_sink_0, 0)) - self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_time_sink_x_0, 0)) - self.connect((self.rational_resampler_xxx_0, 0), (self.qtgui_waterfall_sink_x_0_0, 0)) - - def closeEvent(self, event): - self.settings = Qt.QSettings("GNU Radio", "top_block") - self.settings.setValue("geometry", self.saveGeometry()) - event.accept() - - def get_samp_rate(self): - return self.samp_rate - - def set_samp_rate(self, samp_rate): - self.samp_rate = samp_rate - self.qtgui_waterfall_sink_x_0.set_frequency_range(0, self.samp_rate) - self.blocks_throttle_0.set_sample_rate(self.samp_rate) - - -def main(top_block_cls=top_block, options=None): - - from distutils.version import StrictVersion - if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): - style = gr.prefs().get_string('qtgui', 'style', 'raster') - Qt.QApplication.setGraphicsSystem(style) - qapp = Qt.QApplication(sys.argv) - - tb = top_block_cls() - tb.start() - tb.show() - - def quitting(): - tb.stop() - tb.wait() - qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) - qapp.exec_() - - -if __name__ == '__main__': - main()