From 0efd28de6bc86c3e474cfad70d1e5889575224a7 Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Fri, 6 Apr 2012 15:29:14 +0200 Subject: initial commit --- apps/CMakeLists.txt | 26 ++++ apps/osmosdr_source.grc | 320 ++++++++++++++++++++++++++++++++++++++++++++++++ apps/osmosdr_source.py | 66 ++++++++++ 3 files changed, 412 insertions(+) create mode 100644 apps/CMakeLists.txt create mode 100644 apps/osmosdr_source.grc create mode 100755 apps/osmosdr_source.py (limited to 'apps') diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt new file mode 100644 index 0000000..57c919c --- /dev/null +++ b/apps/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +include(GrPython) + +GR_PYTHON_INSTALL( + PROGRAMS + osmosdr_source.py + DESTINATION bin +) diff --git a/apps/osmosdr_source.grc b/apps/osmosdr_source.grc new file mode 100644 index 0000000..de97388 --- /dev/null +++ b/apps/osmosdr_source.grc @@ -0,0 +1,320 @@ + + + Fri Apr 6 14:59:58 2012 + + options + + id + osmosdr_source_c + + + _enabled + True + + + title + + + + author + + + + description + + + + window_size + 1280, 1024 + + + generate_options + wx_gui + + + category + Custom + + + run_options + prompt + + + run + True + + + realtime_scheduling + + + + _coordinate + (10, 10) + + + _rotation + 0 + + + + variable + + id + samp_rate + + + _enabled + True + + + value + 2048e3 + + + _coordinate + (39, 137) + + + _rotation + 0 + + + + variable_slider + + id + freq + + + _enabled + True + + + label + + + + value + 100e6 + + + min + 50e6 + + + max + 2.2e9 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (268, 65) + + + _rotation + 0 + + + + osmosdr_source_c + + id + osmosdr_source_c_0 + + + _enabled + True + + + args + + + + freq + freq + + + rate + samp_rate + + + gain + gain + + + _coordinate + (284, 297) + + + _rotation + 0 + + + + wxgui_fftsink2 + + id + wxgui_fftsink2_0 + + + _enabled + True + + + type + complex + + + title + FFT Plot + + + samp_rate + samp_rate + + + baseband_freq + freq + + + y_per_div + 5 + + + y_divs + 10 + + + ref_level + 145 + + + ref_scale + 2.0 + + + fft_size + 1024 + + + fft_rate + 15 + + + peak_hold + False + + + average + False + + + avg_alpha + 0 + + + win + None + + + win_size + + + + grid_pos + + + + notebook + + + + _coordinate + (681, 242) + + + _rotation + 0 + + + + variable_slider + + id + gain + + + _enabled + True + + + label + + + + value + 10 + + + min + 0 + + + max + 30 + + + num_steps + 31 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (472, 65) + + + _rotation + 0 + + + + osmosdr_source_c_0 + wxgui_fftsink2_0 + 0 + 0 + + diff --git a/apps/osmosdr_source.py b/apps/osmosdr_source.py new file mode 100755 index 0000000..a6bde0d --- /dev/null +++ b/apps/osmosdr_source.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +################################################## +# Gnuradio Python Flow Graph +# Title: OsmoSDR Source +# Generated: Thu Nov 12 11:26:07 2009 +################################################## + +import osmosdr +from gnuradio import eng_notation +from gnuradio import gr +from gnuradio.eng_option import eng_option +from gnuradio.gr import firdes +from gnuradio.wxgui import fftsink2 +from grc_gnuradio import wxgui as grc_wxgui +from optparse import OptionParser +import wx + +class osmosdr_source_c(grc_wxgui.top_block_gui): + + def __init__(self): + grc_wxgui.top_block_gui.__init__(self, title="OsmoSDR Source") + + self.src = osmosdr.source_c() + + self.src.set_samp_rate(1024000) + self.src.set_center_freq(392.8e6) + self.src.set_gain(10) + + ################################################## + # Variables + ################################################## + self.samp_rate = samp_rate = self.src.get_samp_rate() + + ################################################## + # Blocks + ################################################## + self.sink = fftsink2.fft_sink_c( + self.GetWin(), + fft_size=1024, + sample_rate=samp_rate, + ref_scale=50.0, + ref_level=145, + y_divs=10, + fft_rate=20, + average=False, + avg_alpha=0.5 + ) + + self.Add(self.sink.win) + + ################################################## + # Connections + ################################################## + self.connect((self.src, 0), (self.sink, 0)) + + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.sink.set_sample_rate(self.samp_rate) + +if __name__ == '__main__': + parser = OptionParser(option_class=eng_option, usage="%prog: [options]") + (options, args) = parser.parse_args() + tb = osmosdr_source_c() + tb.Run(True) + -- cgit v1.2.3