summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2018-06-05 11:45:34 +0300
committerYuval Adam <_@yuv.al>2018-06-05 11:45:34 +0300
commitd68d780daf0be139af986f66a08867b4d29c701f (patch)
treef69831d4225ecea583cb795db3f57bc7e4427262
parentd43b1f223d56e846778a4685872b91f6416f117e (diff)
Final changes, showtimev1.0
-rw-r--r--fm.grc14
-rw-r--r--talk.ipynb17
-rw-r--r--talk.slides.html19
-rwxr-xr-xtop_block.py62
4 files changed, 37 insertions, 75 deletions
diff --git a/fm.grc b/fm.grc
index 3637357..a9b9959 100644
--- a/fm.grc
+++ b/fm.grc
@@ -30,7 +30,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(8, 8)</value>
+ <value>(24, 20)</value>
</param>
<param>
<key>_rotation</key>
@@ -38,7 +38,7 @@
</param>
<param>
<key>generate_options</key>
- <value>qt_gui</value>
+ <value>no_gui</value>
</param>
<param>
<key>hier_block_src_path</key>
@@ -186,7 +186,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(640, 168)</value>
+ <value>(656, 196)</value>
</param>
<param>
<key>_rotation</key>
@@ -233,7 +233,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1080, 176)</value>
+ <value>(1112, 204)</value>
</param>
<param>
<key>_rotation</key>
@@ -292,7 +292,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(400, 124)</value>
+ <value>(432, 156)</value>
</param>
<param>
<key>_rotation</key>
@@ -359,7 +359,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(872, 152)</value>
+ <value>(896, 180)</value>
</param>
<param>
<key>_rotation</key>
@@ -1694,7 +1694,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(152, 108)</value>
+ <value>(168, 140)</value>
</param>
<param>
<key>_rotation</key>
diff --git a/talk.ipynb b/talk.ipynb
index 629fc73..207cf32 100644
--- a/talk.ipynb
+++ b/talk.ipynb
@@ -10,7 +10,7 @@
"source": [
"# Pulling radio data out of thin air\n",
"\n",
- "## Pycon Israel 2018"
+ "## Yuval Adam"
]
},
{
@@ -24,8 +24,9 @@
"## Yuval Adam\n",
"\n",
" - Full stack developer and systems architecture consultant\n",
+ " - Using Python for **everything** for 10+ years\n",
" - https://yuv.al\n",
- " - @yuvadm\n",
+ " - [@yuvadm](https://twitter.com/yuvadm)\n",
"\n"
]
},
@@ -242,7 +243,7 @@
"\n",
"sdr = RtlSdr()\n",
"sdr.sample_rate = 1.2e6 # 1,200,000 samples per second\n",
- "sdr.center_freq = 91.8e6 # 91,800,00 Hz frequency for the radio station\n",
+ "sdr.center_freq = 91.8e6 # 91,800,000 Hz frequency for the radio station\n",
"sdr.gain = 'auto' # tune the gain (AKA \"volume\") automatically\n",
"\n",
"samples = sdr.read_samples(1.2e6 * 10)\n",
@@ -318,7 +319,7 @@
"outputs": [],
"source": [
"# De-emphasis filter\n",
- "# Even I'm not sure how/why this works\n",
+ "# Even I'm not sure exactly how/why this works\n",
"\n",
"# MAKE THINGS SOUND BETTER\n",
"\n",
@@ -353,7 +354,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 8,
"metadata": {
"slideshow": {
"slide_type": "subslide"
@@ -387,8 +388,8 @@
"## Review\n",
"\n",
" - Took a fixed set of samples, did some math on them\n",
- " - Python, NumPy and SciPy are **very** good at doing fast processing of static data\n",
- " - When handling real-time data, buffering becomes a serious issue\n",
+ " - Python, NumPy and SciPy are very good at doing fast processing of **static** data\n",
+ " - When handling **real-time** data, buffering becomes a serious issue\n",
" - How do you synchronize different input/ouput sample rates on the same flow?"
]
},
@@ -424,6 +425,8 @@
" - https://osmocom.org/projects/sdr/wiki/rtl-sdr\n",
" - https://www.reddit.com/r/RTLSDR/wiki/index\n",
" - Michael Ossmann's video course - https://greatscottgadgets.com/sdr/\n",
+ " - But you don't really need do know math\n",
+ " - Lots of code is already written\n",
" - Explore the radio waves!"
]
},
diff --git a/talk.slides.html b/talk.slides.html
index c0f8d97..4dd7b00 100644
--- a/talk.slides.html
+++ b/talk.slides.html
@@ -11905,7 +11905,7 @@ a.anchor-link {
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
-<h1 id="Pulling-radio-data-out-of-thin-air">Pulling radio data out of thin air<a class="anchor-link" href="#Pulling-radio-data-out-of-thin-air">&#182;</a></h1><h2 id="Pycon-Israel-2018">Pycon Israel 2018<a class="anchor-link" href="#Pycon-Israel-2018">&#182;</a></h2>
+<h1 id="Pulling-radio-data-out-of-thin-air">Pulling radio data out of thin air<a class="anchor-link" href="#Pulling-radio-data-out-of-thin-air">&#182;</a></h1><h2 id="Yuval-Adam">Yuval Adam<a class="anchor-link" href="#Yuval-Adam">&#182;</a></h2>
</div>
</div>
</div></section></section><section><section>
@@ -11915,8 +11915,9 @@ a.anchor-link {
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Yuval-Adam">Yuval Adam<a class="anchor-link" href="#Yuval-Adam">&#182;</a></h2><ul>
<li>Full stack developer and systems architecture consultant</li>
+<li>Using Python for <strong>everything</strong> for 10+ years</li>
<li><a href="https://yuv.al">https://yuv.al</a></li>
-<li>@yuvadm</li>
+<li><a href="https://twitter.com/yuvadm">@yuvadm</a></li>
</ul>
</div>
@@ -12074,7 +12075,7 @@ a.anchor-link {
<span class="n">sdr</span> <span class="o">=</span> <span class="n">RtlSdr</span><span class="p">()</span>
<span class="n">sdr</span><span class="o">.</span><span class="n">sample_rate</span> <span class="o">=</span> <span class="mf">1.2e6</span> <span class="c1"># 1,200,000 samples per second</span>
-<span class="n">sdr</span><span class="o">.</span><span class="n">center_freq</span> <span class="o">=</span> <span class="mf">91.8e6</span> <span class="c1"># 91,800,00 Hz frequency for the radio station</span>
+<span class="n">sdr</span><span class="o">.</span><span class="n">center_freq</span> <span class="o">=</span> <span class="mf">91.8e6</span> <span class="c1"># 91,800,000 Hz frequency for the radio station</span>
<span class="n">sdr</span><span class="o">.</span><span class="n">gain</span> <span class="o">=</span> <span class="s1">&#39;auto&#39;</span> <span class="c1"># tune the gain (AKA &quot;volume&quot;) automatically</span>
<span class="n">samples</span> <span class="o">=</span> <span class="n">sdr</span><span class="o">.</span><span class="n">read_samples</span><span class="p">(</span><span class="mf">1.2e6</span> <span class="o">*</span> <span class="mi">10</span><span class="p">)</span>
@@ -12150,7 +12151,7 @@ a.anchor-link {
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># De-emphasis filter</span>
-<span class="c1"># Even I&#39;m not sure how/why this works</span>
+<span class="c1"># Even I&#39;m not sure exactly how/why this works</span>
<span class="c1"># MAKE THINGS SOUND BETTER</span>
@@ -12190,7 +12191,7 @@ a.anchor-link {
</div></section><section>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
-<div class="prompt input_prompt">In&nbsp;[7]:</div>
+<div class="prompt input_prompt">In&nbsp;[6]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="c1"># HIT IT</span>
@@ -12219,8 +12220,8 @@ a.anchor-link {
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Review">Review<a class="anchor-link" href="#Review">&#182;</a></h2><ul>
<li>Took a fixed set of samples, did some math on them</li>
-<li>Python, NumPy and SciPy are <strong>very</strong> good at doing fast processing of static data</li>
-<li>When handling real-time data, buffering becomes a serious issue<ul>
+<li>Python, NumPy and SciPy are very good at doing fast processing of <strong>static</strong> data</li>
+<li>When handling <strong>real-time</strong> data, buffering becomes a serious issue<ul>
<li>How do you synchronize different input/ouput sample rates on the same flow?</li>
</ul>
</li>
@@ -12258,6 +12259,10 @@ a.anchor-link {
<li>Michael Ossmann's video course - <a href="https://greatscottgadgets.com/sdr/">https://greatscottgadgets.com/sdr/</a></li>
</ul>
</li>
+<li>But you don't really need do know math<ul>
+<li>Lots of code is already written</li>
+</ul>
+</li>
<li>Explore the radio waves!</li>
</ul>
diff --git a/top_block.py b/top_block.py
index 8e104f7..344ef7d 100755
--- a/top_block.py
+++ b/top_block.py
@@ -3,20 +3,9 @@
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
-# Generated: Mon May 28 19:47:27 2018
+# Generated: Tue Jun 5 07:29:57 2018
##################################################
-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 audio
from gnuradio import eng_notation
@@ -26,36 +15,13 @@ from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import osmosdr
-import sys
import time
-from gnuradio import qtgui
-class top_block(gr.top_block, Qt.QWidget):
+class top_block(gr.top_block):
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
@@ -102,11 +68,6 @@ class top_block(gr.top_block, Qt.QWidget):
self.connect((self.rational_resampler_xxx_0, 0), (self.audio_sink_0, 0))
self.connect((self.rtlsdr_source_0, 0), (self.low_pass_filter_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
@@ -131,21 +92,14 @@ class top_block(gr.top_block, Qt.QWidget):
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_()
+ try:
+ raw_input('Press Enter to quit: ')
+ except EOFError:
+ pass
+ tb.stop()
+ tb.wait()
if __name__ == '__main__':