[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5789 - in grc/branches/jblum_work: examples examples/
From: |
jblum |
Subject: |
[Commit-gnuradio] r5789 - in grc/branches/jblum_work: examples examples/audio notes src src/Elements src/Graphics src/SignalBlockDefs |
Date: |
Sun, 17 Jun 2007 01:13:36 -0600 (MDT) |
Author: jblum
Date: 2007-06-17 01:13:36 -0600 (Sun, 17 Jun 2007)
New Revision: 5789
Added:
grc/branches/jblum_work/examples/audio/b_flat_scale.grc.xml
grc/branches/jblum_work/examples/audio/phone_tones.grc.xml
grc/branches/jblum_work/examples/channel_noise.grc.xml
grc/branches/jblum_work/examples/noisy_sinusoid.grc.xml
grc/branches/jblum_work/examples/null_to_null.grc.xml
grc/branches/jblum_work/examples/packet_mod_demod.grc.xml
Removed:
grc/branches/jblum_work/examples/audio/B flat.grc.xml
grc/branches/jblum_work/examples/audio/phone tones.grc.xml
grc/branches/jblum_work/examples/channel noise.grc.xml
grc/branches/jblum_work/examples/noisy sinusoid.grc.xml
grc/branches/jblum_work/examples/null to null.grc.xml
grc/branches/jblum_work/examples/qam.grc.xml
Modified:
grc/branches/jblum_work/examples/variable_sink.grc.xml
grc/branches/jblum_work/notes/notes.txt
grc/branches/jblum_work/src/Colors.py
grc/branches/jblum_work/src/Elements/GraphicalSocket.py
grc/branches/jblum_work/src/ExecFlowGraph.py
grc/branches/jblum_work/src/Graphics/Dialogs.py
grc/branches/jblum_work/src/SignalBlockDefs/Packet.py
grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py
grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py
Log:
working packet modulator/demodulator
Deleted: grc/branches/jblum_work/examples/audio/B flat.grc.xml
Copied: grc/branches/jblum_work/examples/audio/b_flat_scale.grc.xml (from rev
5751, grc/branches/jblum_work/examples/audio/B flat.grc.xml)
===================================================================
--- grc/branches/jblum_work/examples/audio/b_flat_scale.grc.xml
(rev 0)
+++ grc/branches/jblum_work/examples/audio/b_flat_scale.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<flow_graph>
+ <timestamp>1179256591.06</timestamp>
+ <hostname>bowlcut</hostname>
+ <version>0.70 alpha</version>
+ <valid>True</valid>
+ <window_width>800</window_width>
+ <window_height>600</window_height>
+ <vars>
+ <var>
+ <key>samp_rate</key>
+ <value>32000</value>
+ <min/>
+ <max/>
+ <step/>
+ </var>
+ <var>
+ <key>A</key>
+ <value>440</value>
+ <min/>
+ <max/>
+ <step/>
+ </var>
+ <var>
+ <key>n</key>
+ <value>0</value>
+ <min>-4</min>
+ <max>8</max>
+ <step>1</step>
+ </var>
+ <var>
+ <key>volume</key>
+ <value>.1</value>
+ <min>0</min>
+ <max>.5</max>
+ <step>0.005</step>
+ </var>
+ </vars>
+ <signal_blocks>
+ <signal_block>
+ <tag>About</tag>
+ <id>About0</id>
+ <x_coordinate>91</x_coordinate>
+ <y_coordinate>41</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>B flat</param>
+ <param>Josh Blum</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Note</tag>
+ <id>Note0</id>
+ <x_coordinate>30</x_coordinate>
+ <y_coordinate>136</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>Generate pure musical tones.</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Scope Sink</tag>
+ <id>Scope Sink0</id>
+ <x_coordinate>31</x_coordinate>
+ <y_coordinate>251</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>Scope</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>.1</param>
+ <param>.001</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Audio Sink</tag>
+ <id>Audio Sink0</id>
+ <x_coordinate>27</x_coordinate>
+ <y_coordinate>429</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>3</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Signal Source</tag>
+ <id>Signal Source0</id>
+ <x_coordinate>411</x_coordinate>
+ <y_coordinate>344</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>$A*2^($n/12)</param>
+ <param>$volume</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ </signal_blocks>
+ <connections>
+ <connection>
+ <input_signal_block_id>Audio Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Signal Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Scope Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Signal Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ </connections>
+</flow_graph>
Deleted: grc/branches/jblum_work/examples/audio/phone tones.grc.xml
Copied: grc/branches/jblum_work/examples/audio/phone_tones.grc.xml (from rev
5751, grc/branches/jblum_work/examples/audio/phone tones.grc.xml)
===================================================================
--- grc/branches/jblum_work/examples/audio/phone_tones.grc.xml
(rev 0)
+++ grc/branches/jblum_work/examples/audio/phone_tones.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -0,0 +1,206 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<flow_graph>
+ <timestamp>1179256705.05</timestamp>
+ <hostname>bowlcut</hostname>
+ <version>0.70 alpha</version>
+ <valid>True</valid>
+ <window_width>1200</window_width>
+ <window_height>800</window_height>
+ <vars>
+ <var>
+ <key>samp_rate</key>
+ <value>32e3</value>
+ <min/>
+ <max/>
+ <step/>
+ </var>
+ <var>
+ <key>volume</key>
+ <value>.1</value>
+ <min>0</min>
+ <max>.5</max>
+ <step>0.005</step>
+ </var>
+ <var>
+ <key>noise</key>
+ <value>.01</value>
+ <min>0</min>
+ <max>.1</max>
+ <step>0.001</step>
+ </var>
+ </vars>
+ <signal_blocks>
+ <signal_block>
+ <tag>Signal Source</tag>
+ <id>Signal Source1</id>
+ <x_coordinate>192</x_coordinate>
+ <y_coordinate>377</y_coordinate>
+ <rotation>90</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>440</param>
+ <param>1</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Noise Source</tag>
+ <id>Noise Source0</id>
+ <x_coordinate>335</x_coordinate>
+ <y_coordinate>364</y_coordinate>
+ <rotation>90</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ <param>$noise</param>
+ <param>71</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>FFT Sink</tag>
+ <id>FFT Sink0</id>
+ <x_coordinate>856</x_coordinate>
+ <y_coordinate>366</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>1</param>
+ <param>FFT</param>
+ <param>$samp_rate</param>
+ <param>20</param>
+ <param>20</param>
+ <param>512</param>
+ <param>15</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Signal Source</tag>
+ <id>Signal Source0</id>
+ <x_coordinate>34</x_coordinate>
+ <y_coordinate>366</y_coordinate>
+ <rotation>90</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>350</param>
+ <param>1</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Scope Sink</tag>
+ <id>Scope Sink0</id>
+ <x_coordinate>562</x_coordinate>
+ <y_coordinate>387</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>1</param>
+ <param>Scope</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>0</param>
+ <param>0.001</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Audio Sink</tag>
+ <id>Audio Sink0</id>
+ <x_coordinate>742</x_coordinate>
+ <y_coordinate>409</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>3</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Multiply Constant</tag>
+ <id>Multiply Constant0</id>
+ <x_coordinate>594</x_coordinate>
+ <y_coordinate>221</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>1</param>
+ <param>$volume</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Add</tag>
+ <id>Add0</id>
+ <x_coordinate>420</x_coordinate>
+ <y_coordinate>133</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>1</param>
+ <param>3</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Note</tag>
+ <id>Note0</id>
+ <x_coordinate>362</x_coordinate>
+ <y_coordinate>58</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>350 hz + 440 hz + AWGN</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>About</tag>
+ <id>About0</id>
+ <x_coordinate>71</x_coordinate>
+ <y_coordinate>48</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>The Famous Phone Tones</param>
+ <param>Josh Blum</param>
+ </params>
+ </signal_block>
+ </signal_blocks>
+ <connections>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Signal Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>1</input_socket_index>
+ <output_signal_block_id>Signal Source1</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Multiply Constant0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Add0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Audio Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Multiply Constant0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>2</input_socket_index>
+ <output_signal_block_id>Noise Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>FFT Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Multiply Constant0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Scope Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Multiply Constant0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ </connections>
+</flow_graph>
Deleted: grc/branches/jblum_work/examples/channel noise.grc.xml
Copied: grc/branches/jblum_work/examples/channel_noise.grc.xml (from rev 5751,
grc/branches/jblum_work/examples/channel noise.grc.xml)
===================================================================
--- grc/branches/jblum_work/examples/channel_noise.grc.xml
(rev 0)
+++ grc/branches/jblum_work/examples/channel_noise.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -0,0 +1,185 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<flow_graph>
+ <timestamp>1179256617.68</timestamp>
+ <hostname>bowlcut</hostname>
+ <version>0.70 alpha</version>
+ <valid>True</valid>
+ <window_width>1200</window_width>
+ <window_height>800</window_height>
+ <vars>
+ <var>
+ <key>samp_rate</key>
+ <value>32e3</value>
+ <min/>
+ <max/>
+ <step/>
+ </var>
+ <var>
+ <key>low_cutoff</key>
+ <value>3.5e3</value>
+ <min>1e3</min>
+ <max>10e3</max>
+ <step>150.0</step>
+ </var>
+ </vars>
+ <signal_blocks>
+ <signal_block>
+ <tag>Float to Complex</tag>
+ <id>Float to Complex0</id>
+ <x_coordinate>344</x_coordinate>
+ <y_coordinate>70</y_coordinate>
+ <rotation>0</rotation>
+ <params/>
+ </signal_block>
+ <signal_block>
+ <tag>Noise Source</tag>
+ <id>Noise Source0</id>
+ <x_coordinate>38</x_coordinate>
+ <y_coordinate>353</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ <param>0.025</param>
+ <param>62</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>About</tag>
+ <id>About0</id>
+ <x_coordinate>20</x_coordinate>
+ <y_coordinate>20</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>Channel Noise</param>
+ <param>Josh Blum</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Note</tag>
+ <id>Note0</id>
+ <x_coordinate>20</x_coordinate>
+ <y_coordinate>100</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>Band-pass-filtered noise.</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Signal Source</tag>
+ <id>Signal Source0</id>
+ <x_coordinate>51</x_coordinate>
+ <y_coordinate>190</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>5000</param>
+ <param>1</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Add</tag>
+ <id>Add0</id>
+ <x_coordinate>310</x_coordinate>
+ <y_coordinate>261</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>1</param>
+ <param>2</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>FFT Sink</tag>
+ <id>FFT Sink1</id>
+ <x_coordinate>615</x_coordinate>
+ <y_coordinate>48</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>0</param>
+ <param>FFT - Input</param>
+ <param>$samp_rate</param>
+ <param>20</param>
+ <param>20</param>
+ <param>512</param>
+ <param>15</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>FFT Sink</tag>
+ <id>FFT Sink0</id>
+ <x_coordinate>307</x_coordinate>
+ <y_coordinate>399</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>0</param>
+ <param>FFT - BPF</param>
+ <param>$samp_rate</param>
+ <param>20</param>
+ <param>20</param>
+ <param>512</param>
+ <param>15</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Band Pass Filter</tag>
+ <id>Band Pass Filter0</id>
+ <x_coordinate>598</x_coordinate>
+ <y_coordinate>322</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>$low_cutoff</param>
+ <param>3000+$low_cutoff</param>
+ <param>500</param>
+ <param>1</param>
+ <param>1</param>
+ <param>6.76</param>
+ </params>
+ </signal_block>
+ </signal_blocks>
+ <connections>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Signal Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>1</input_socket_index>
+ <output_signal_block_id>Noise Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Float to Complex0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Add0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Band Pass Filter0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Float to Complex0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>FFT Sink1</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Float to Complex0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>FFT Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Band Pass Filter0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ </connections>
+</flow_graph>
Deleted: grc/branches/jblum_work/examples/noisy sinusoid.grc.xml
Copied: grc/branches/jblum_work/examples/noisy_sinusoid.grc.xml (from rev 5751,
grc/branches/jblum_work/examples/noisy sinusoid.grc.xml)
===================================================================
--- grc/branches/jblum_work/examples/noisy_sinusoid.grc.xml
(rev 0)
+++ grc/branches/jblum_work/examples/noisy_sinusoid.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -0,0 +1,168 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<flow_graph>
+ <timestamp>1179256658.68</timestamp>
+ <hostname>bowlcut</hostname>
+ <version>0.70 alpha</version>
+ <valid>True</valid>
+ <window_width>1000</window_width>
+ <window_height>600</window_height>
+ <vars>
+ <var>
+ <key>samp_rate</key>
+ <value>32000</value>
+ <min/>
+ <max/>
+ <step/>
+ </var>
+ <var>
+ <key>source_freq</key>
+ <value>350</value>
+ <min>300</min>
+ <max>1e3</max>
+ <step>7.0</step>
+ </var>
+ <var>
+ <key>noise_amp</key>
+ <value>.005</value>
+ <min>.005</min>
+ <max>.05</max>
+ <step>0.001</step>
+ </var>
+ </vars>
+ <signal_blocks>
+ <signal_block>
+ <tag>Note</tag>
+ <id>Note0</id>
+ <x_coordinate>514</x_coordinate>
+ <y_coordinate>24</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>An example of additive noise.</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>About</tag>
+ <id>About0</id>
+ <x_coordinate>333</x_coordinate>
+ <y_coordinate>26</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>Noisy Sinusoid</param>
+ <param>Josh Blum</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Noise Source</tag>
+ <id>Noise Source0</id>
+ <x_coordinate>615</x_coordinate>
+ <y_coordinate>357</y_coordinate>
+ <rotation>90</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ <param>$noise_amp</param>
+ <param>79</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Audio Sink</tag>
+ <id>Audio Sink0</id>
+ <x_coordinate>280</x_coordinate>
+ <y_coordinate>377</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>3</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Signal Source</tag>
+ <id>Signal Source0</id>
+ <x_coordinate>625</x_coordinate>
+ <y_coordinate>133</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>$source_freq</param>
+ <param>.1</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>FFT Sink</tag>
+ <id>FFT Sink0</id>
+ <x_coordinate>71</x_coordinate>
+ <y_coordinate>70</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>FFT</param>
+ <param>$samp_rate</param>
+ <param>20</param>
+ <param>20</param>
+ <param>512</param>
+ <param>15</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Scope Sink</tag>
+ <id>Scope Sink0</id>
+ <x_coordinate>53</x_coordinate>
+ <y_coordinate>238</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>Scope</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>0</param>
+ <param>0.001</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Add</tag>
+ <id>Add0</id>
+ <x_coordinate>427</x_coordinate>
+ <y_coordinate>217</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>2</param>
+ </params>
+ </signal_block>
+ </signal_blocks>
+ <connections>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>1</input_socket_index>
+ <output_signal_block_id>Signal Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Add0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Noise Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Audio Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Add0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>FFT Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Add0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Scope Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Add0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ </connections>
+</flow_graph>
Deleted: grc/branches/jblum_work/examples/null to null.grc.xml
Copied: grc/branches/jblum_work/examples/null_to_null.grc.xml (from rev 5751,
grc/branches/jblum_work/examples/null to null.grc.xml)
===================================================================
--- grc/branches/jblum_work/examples/null_to_null.grc.xml
(rev 0)
+++ grc/branches/jblum_work/examples/null_to_null.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -0,0 +1,52 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<flow_graph>
+ <timestamp>1179256695.11</timestamp>
+ <hostname>bowlcut</hostname>
+ <version>0.70 alpha</version>
+ <valid>True</valid>
+ <window_width>1200</window_width>
+ <window_height>800</window_height>
+ <vars/>
+ <signal_blocks>
+ <signal_block>
+ <tag>Null Source</tag>
+ <id>Null Source0</id>
+ <x_coordinate>168</x_coordinate>
+ <y_coordinate>250</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Null Sink</tag>
+ <id>Null Sink0</id>
+ <x_coordinate>307</x_coordinate>
+ <y_coordinate>270</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Note</tag>
+ <id>Note0</id>
+ <x_coordinate>172</x_coordinate>
+ <y_coordinate>121</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>Use 100% CPU</param>
+ </params>
+ </signal_block>
+ </signal_blocks>
+ <connections>
+ <connection>
+ <input_signal_block_id>Null Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Null Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ </connections>
+</flow_graph>
Added: grc/branches/jblum_work/examples/packet_mod_demod.grc.xml
===================================================================
--- grc/branches/jblum_work/examples/packet_mod_demod.grc.xml
(rev 0)
+++ grc/branches/jblum_work/examples/packet_mod_demod.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -0,0 +1,165 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<flow_graph>
+ <timestamp>1182064037.15</timestamp>
+ <hostname>tiggle</hostname>
+ <version>0.70 alpha</version>
+ <valid>True</valid>
+ <window_width>1600</window_width>
+ <window_height>1200</window_height>
+ <vars>
+ <var>
+ <key>samp_rate</key>
+ <value>100e3</value>
+ <min/>
+ <max/>
+ <step/>
+ </var>
+ </vars>
+ <signal_blocks>
+ <signal_block>
+ <tag>About</tag>
+ <id>About0</id>
+ <x_coordinate>20</x_coordinate>
+ <y_coordinate>20</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>Packet Mod/Demod</param>
+ <param>Josh Blum</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Signal Source</tag>
+ <id>Signal Source0</id>
+ <x_coordinate>47</x_coordinate>
+ <y_coordinate>350</y_coordinate>
+ <rotation>90</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>1000</param>
+ <param>1</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Packet Demodulator</tag>
+ <id>Packet Demodulator0</id>
+ <x_coordinate>647</x_coordinate>
+ <y_coordinate>414</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param/>
+ <param>-1</param>
+ <param>2</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Packet Modulator</tag>
+ <id>Packet Modulator0</id>
+ <x_coordinate>278</x_coordinate>
+ <y_coordinate>37</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>1</param>
+ <param>1</param>
+ <param>$samp_rate</param>
+ <param>2</param>
+ <param>100</param>
+ <param/>
+ <param>2</param>
+ <param>0</param>
+ <param>1</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>PSK Modulator</tag>
+ <id>PSK Modulator0</id>
+ <x_coordinate>548</x_coordinate>
+ <y_coordinate>31</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>0</param>
+ <param>2</param>
+ <param>0.35</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>PSK Demodulator</tag>
+ <id>PSK Demodulator0</id>
+ <x_coordinate>774</x_coordinate>
+ <y_coordinate>119</y_coordinate>
+ <rotation>270</rotation>
+ <params>
+ <param>0</param>
+ <param>2</param>
+ <param>0.35</param>
+ <param>0.03</param>
+ <param>0.05</param>
+ <param>0.005</param>
+ <param>0.05</param>
+ <param>0</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Scope Sink</tag>
+ <id>Scope Sink0</id>
+ <x_coordinate>276</x_coordinate>
+ <y_coordinate>405</y_coordinate>
+ <rotation>180</rotation>
+ <params>
+ <param>1</param>
+ <param>Scope</param>
+ <param>$samp_rate</param>
+ <param>1</param>
+ <param>0</param>
+ <param>0.001</param>
+ </params>
+ </signal_block>
+ <signal_block>
+ <tag>Note</tag>
+ <id>Note0</id>
+ <x_coordinate>347</x_coordinate>
+ <y_coordinate>264</y_coordinate>
+ <rotation>0</rotation>
+ <params>
+ <param>A demonstration of the packet framework.</param>
+ </params>
+ </signal_block>
+ </signal_blocks>
+ <connections>
+ <connection>
+ <input_signal_block_id>Packet Modulator0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Signal Source0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Scope Sink0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Packet Demodulator0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>PSK Modulator0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>Packet Modulator0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>Packet Demodulator0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>PSK Demodulator0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ <connection>
+ <input_signal_block_id>PSK Demodulator0</input_signal_block_id>
+ <input_socket_index>0</input_socket_index>
+ <output_signal_block_id>PSK Modulator0</output_signal_block_id>
+ <output_socket_index>0</output_socket_index>
+ </connection>
+ </connections>
+</flow_graph>
Deleted: grc/branches/jblum_work/examples/qam.grc.xml
Modified: grc/branches/jblum_work/examples/variable_sink.grc.xml
===================================================================
--- grc/branches/jblum_work/examples/variable_sink.grc.xml 2007-06-17
06:59:13 UTC (rev 5788)
+++ grc/branches/jblum_work/examples/variable_sink.grc.xml 2007-06-17
07:13:36 UTC (rev 5789)
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<flow_graph>
- <timestamp>1179795210.8</timestamp>
+ <timestamp>1182064071.08</timestamp>
<hostname>tiggle</hostname>
<version>0.70 alpha</version>
<valid>True</valid>
@@ -142,6 +142,7 @@
<param>1</param>
<param>output</param>
<param>$samp_rate_in</param>
+ <param>2</param>
</params>
</signal_block>
</signal_blocks>
Modified: grc/branches/jblum_work/notes/notes.txt
===================================================================
--- grc/branches/jblum_work/notes/notes.txt 2007-06-17 06:59:13 UTC (rev
5788)
+++ grc/branches/jblum_work/notes/notes.txt 2007-06-17 07:13:36 UTC (rev
5789)
@@ -16,7 +16,6 @@
-changing an enum doesnt call update for params with variable datatypes
############ Features to Add: ####################
--packet framework
-save settings after close (working directory)
-create sub-flow graphs to be used in larger flow graphs
-include dtd in saved flow graphs
Modified: grc/branches/jblum_work/src/Colors.py
===================================================================
--- grc/branches/jblum_work/src/Colors.py 2007-06-17 06:59:13 UTC (rev
5788)
+++ grc/branches/jblum_work/src/Colors.py 2007-06-17 07:13:36 UTC (rev
5789)
@@ -39,8 +39,6 @@
INT_VECTOR_COLOR_SPEC = '#00CC99'
SHORT_VECTOR_COLOR_SPEC = '#CCCC33'
BYTE_VECTOR_COLOR_SPEC = '#CC66CC'
-# misc #
-STRING_COLOR_SPEC = '#FFFFFF'
COLORMAP = gtk.gdk.colormap_get_system() #create all of the colors
BACKGROUND_COLOR = COLORMAP.alloc_color('#FFF9FF', True, True) #main window
background
@@ -60,5 +58,3 @@
SHORT_VECTOR_COLOR = COLORMAP.alloc_color(SHORT_VECTOR_COLOR_SPEC, True, True)
#background for shorts (yellowish)
INT_VECTOR_COLOR = COLORMAP.alloc_color(INT_VECTOR_COLOR_SPEC, True, True)
#background for ints (greenish)
BYTE_VECTOR_COLOR = COLORMAP.alloc_color(BYTE_VECTOR_COLOR_SPEC, True, True)
#background for bytes (purplish)
-# misc #
-STRING_COLOR = COLORMAP.alloc_color(STRING_COLOR_SPEC, True, True)
#background for strings (white)
Modified: grc/branches/jblum_work/src/Elements/GraphicalSocket.py
===================================================================
--- grc/branches/jblum_work/src/Elements/GraphicalSocket.py 2007-06-17
06:59:13 UTC (rev 5788)
+++ grc/branches/jblum_work/src/Elements/GraphicalSocket.py 2007-06-17
07:13:36 UTC (rev 5789)
@@ -49,8 +49,6 @@
IntVector().get_type():Colors.INT_VECTOR_COLOR,
ShortVector().get_type():Colors.SHORT_VECTOR_COLOR,
ByteVector().get_type():Colors.BYTE_VECTOR_COLOR,
- # misc #
- String().get_type():Colors.STRING_COLOR,
}[self.get_data_type().get_type()]
self._create_labels()
# add the input/output area for each rotation angle
#
Modified: grc/branches/jblum_work/src/ExecFlowGraph.py
===================================================================
--- grc/branches/jblum_work/src/ExecFlowGraph.py 2007-06-17 06:59:13 UTC
(rev 5788)
+++ grc/branches/jblum_work/src/ExecFlowGraph.py 2007-06-17 07:13:36 UTC
(rev 5789)
@@ -28,7 +28,6 @@
import os
from Constants import DEFAULT_FILE_EXTENSION
from optparse import OptionParser
-from SignalBlockDefs import Packet
##############################################################################################
# Flow Graph Builder
@@ -94,9 +93,7 @@
output_socket_index = int(find_data(connection,
'output_socket_index'))
input_signal_block =
signal_blocks_dict[input_signal_block_id]
output_signal_block =
signal_blocks_dict[output_signal_block_id]
- if Packet.is_packet_block(input_signal_block) and
Packet.is_packet_block(output_signal_block):
-
Packet.connect_packet_blocks(output_signal_block, input_signal_block)
- else: self.connect(# use this flow graph's connect
method #
+ self.connect(# use this flow graph's connect method
#
(output_signal_block, output_socket_index),
(input_signal_block, input_socket_index))
Modified: grc/branches/jblum_work/src/Graphics/Dialogs.py
===================================================================
--- grc/branches/jblum_work/src/Graphics/Dialogs.py 2007-06-17 06:59:13 UTC
(rev 5788)
+++ grc/branches/jblum_work/src/Graphics/Dialogs.py 2007-06-17 07:13:36 UTC
(rev 5789)
@@ -177,8 +177,6 @@
('Int Vector', Colors.INT_VECTOR_COLOR_SPEC),
('Short Vector', Colors.SHORT_VECTOR_COLOR_SPEC),
('Byte Vector', Colors.BYTE_VECTOR_COLOR_SPEC),
- 'Misc:',
- ('String/Packet', Colors.STRING_COLOR_SPEC),
):
if type(color_spec) == type(str()): markup =
'%s\n\n<b>%s</b>'%(markup, color_spec)
else:
Modified: grc/branches/jblum_work/src/SignalBlockDefs/Packet.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Packet.py 2007-06-17
06:59:13 UTC (rev 5788)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Packet.py 2007-06-17
07:13:36 UTC (rev 5789)
@@ -20,47 +20,129 @@
#Support for the gr packet framework.
address@hidden Josh Blum
+import threading
from DataTypes import *
-from gnuradio import gr,blks
-from SignalBlockConstants import all_choices
+from gnuradio import gr,blks,packet_utils
+from SignalBlockConstants import all_choices,default_samp_rate
-packet_attr = 'packet based'
-packet_mod = 'packet mod'
-packet_demod = 'packet demod'
-packet_to_stream = 'packet to stream'
-stream_to_packet = 'stream to packet'
+MAX_ACCESS_CODE_LENGTH = 64
+MAX_PACKET_LENGTH = len(packet_utils.random_mask_tuple)#4096
+DEFAULT_QUEUE_LIMIT = 2
+DEFAULT_PACKET_LENGTH = 100
-def is_packet_block(block):
- """!
- Is the block a packet based block?
- @param block the gr block
- @return true if the block is packet based
+#######################################################################################
+## Packet Modulator and Demodulator Hier Block
+#######################################################################################
+
+class PacketModThread(threading.Thread):
"""
- return hasattr(block, packet_attr)
-
-def connect_packet_blocks(output_block, input_block):
- """!
- Connect two packet based blocks.
- Use callback functions in combination with message queues and threads
- to transfer data between input and output blocks.
- @param output_block message sink/packet demod
- @param input_block message source/packet mod
+ Thread to forward data between the message queue and the packet
modulator.
+ Read messages from the message queue, slice them up to the packet
length,
+ and pass them to the send packet function.
"""
- output_attr = getattr(output_block, packet_attr)
- input_attr = getattr(input_block, packet_attr)
- if output_attr == packet_demod and input_attr == packet_mod:
- output_block._watcher.callback = lambda ok, payload:
input_block.send_pkt(payload)
- #elif output_attr == packet_demod and input_attr == packet to stream:
- #output_block._watcher.callback = lambda ok, payload:
input_block.msgq().
+ def __init__(self, msgq, send_packet, packet_length):
+ """!
+ PacketModThread contructor.
+ @param msgq the message queue with incoming data
+ @param send_packet a function of one argument to send a packet
+ """
+ self.msgq = msgq
+ self.send_packet = send_packet
+ self.packet_length = packet_length
+ threading.Thread.__init__(self)
+ self.start()
+ print 'Created packet modulator thread.'
+
+ def run(self):
+ """In an endless while loop: read the msgq and call send
packet."""
+ r = '' #residual message
+ while True:
+ try:
+ msg = self.msgq.delete_head() # blocking read
of message queue
+ sr = r + msg.to_string()
+ num_packets = len(sr)/int(self.packet_length)
#integer arithmetic
+ r_index = self.packet_length*num_packets
+ s = sr[0:r_index] #portion of message
divisible by packet size
+ r = sr[r_index:] #residual portion of
message smaller then packet size
+ #print len(s), len(r), msg.type(), msg.arg1(),
msg.arg2()
+ for i in range(num_packets):
self.send_packet(s[i*self.packet_length:(i+1)*self.packet_length])
+ except Exception, e:
+ print "done", e
+ break
+class PacketModHelper(gr.hier_block):
+ """Forward data from the gr data stream to the mod packet."""
+ def __init__(self, fg, item_size, packet_length, samp_rate,
samples_per_symbol, bits_per_symbol, access_code, msgq_limit, pad_for_usrp,
use_whitener_offset):
+ """!
+ PacketModHelper constructor.
+ @param fg the flow graph
+ @param item_size the size in bytes of the input data stream
+ @param packet_length the length in bytes of the packets
+ @param samp_rate the sample rate for the throttle
+ @param *args the arguments for blks.mod_pkts
+ """
+ #dummy modulator with access functions
+ modulator = gr.skiphead(Byte().get_num_bytes(), 0)
#skip nothing
+ modulator.samples_per_symbol = lambda: samples_per_symbol
+ modulator.bits_per_symbol = lambda: bits_per_symbol
+ #create the packet modulator (handles the output data stream)
+ packet_mod = blks.mod_pkts(
+ fg=fg,
+ modulator=modulator,
+ access_code=access_code,
+ msgq_limit=msgq_limit,
+ pad_for_usrp=pad_for_usrp,
+ use_whitener_offset=use_whitener_offset,
+ )
+ #the throttle (handles the input data stream)
+ throttle = gr.throttle(item_size, samp_rate)
+ #the message sink
+ msgq = gr.msg_queue(msgq_limit)
+ msg_sink = gr.message_sink(item_size, msgq, True)
+ #create hier block
+ fg.connect(throttle, msg_sink)
+ gr.hier_block.__init__(self, fg, throttle, packet_mod)
+ #create/start the thread
+ PacketModThread(msgq, packet_mod.send_pkt, packet_length)
+
+class PacketDemodHelper(gr.hier_block):
+ """Forward data from demod packet to the gr data stream."""
+ def __init__(self, fg, item_size, samp_rate, access_code, threshold,
msgq_limit):
+ """!
+ PacketDemodHelper constructor.
+ @param fg the flow graph
+ @param item_size the size in bytes of the output data stream
+ @param samp_rate the sample rate for the throttle
+ @param *args the arguments for blks.demod_pkts
+ @param msgq_limit the queue limit for the message source
+ """
+ #the message source (handles the output data stream)
+ msg_source = gr.message_source(item_size, msgq_limit)
+ msgq = msg_source.msgq()
+ callback = lambda ok, payload: \
+ msgq.insert_tail(gr.message_from_string(payload, 0,
item_size, len(payload)/item_size))
+ #dummy demodulator with access functions
+ demodulator = gr.throttle(Byte().get_num_bytes(), samp_rate)
#skip nothing
+ #create the packet demodulator (handles the input data stream)
+ packet_demod = blks.demod_pkts(
+ fg=fg,
+ demodulator=demodulator,
+ access_code=access_code,
+ callback=callback,
+ threshold=threshold,
+ )
+ #create hier block
+ gr.hier_block.__init__(self, fg, packet_demod, msg_source)
+
#######################################################################################
-## Packet Modulator and Demodulator
+## Packet Modulator and Demodulator Defs
#######################################################################################
def PacketMod(sb):
- fcn = blks.mod_pkts
- sb.add_input_socket('pin', String(), optional=True) #packet
input
+ type = Enum(all_choices, 1)
+ sb.add_input_socket('in', Variable(type)) #packet input
sb.add_output_socket('out', Byte())
+ sb.add_param('Type', type, False, type=True)
sb.add_param('Modulator Type', Enum([
('GMSK', blks.gmsk_mod),
('DBPSK', blks.dbpsk_mod),
@@ -69,96 +151,77 @@
('QAM 8', blks.qam8_mod),
('QAM 64', blks.qam64_mod),
('QAM 256', blks.qam256_mod),
- ]), type=True)
- sb.add_param('Samples/Symbol', Int(2, min=1))
- sb.add_param('Access Code', String('', max=64))
- sb.add_param('Message Queue Limit', Int(2, min=1))
+ ]))
+ sb.add_param('Sampling Rate', Float(default_samp_rate))
+ sb.add_param('Samples/Symbol', Int(DEFAULT_QUEUE_LIMIT, min=1))
+ sb.add_param('Packet Length', Int(DEFAULT_PACKET_LENGTH, min=1,
max=MAX_PACKET_LENGTH))
+ sb.add_param('Access Code', String('', max=MAX_ACCESS_CODE_LENGTH))
+ sb.add_param('Queue Limit', Int(2, min=1))
sb.add_param('Pad for USRP', Bool(true='Yes', false='No', default=True))
sb.add_param('Use Whitener Offset', Bool(true='Yes', false='No',
default=False))
sb.set_docs('''\
-Send packets to the modulator.
+The packet modulator wraps a data stream into packets.
+---
+Packet length: length of a packet, no greater than %d.
-Access code/sync vector: string of 1's and 0's between 1 and 64 long. Leave
blank for default.
-Msgq limit: maximum number of messages in message queue.
+Access code/sync vector: string of 1's and 0's between 1 and %d long. Leave
blank for default.
+
+Queue limit: maximum number of messages in message queue.
+
Pad for USRP: If true, packets are padded such that they end up a multiple of
128 samples.
+
Use whitener offset: If true, start of whitener XOR string is incremented each
packet.
-''')
- def make(fg, mod_type, samps_per_symbol, access_code, msgq_limit,
pad_for_usrp, use_whitener_offset):
+---
+The packet modulator has a throttle automatically attatched to it at runtime
to save the CPU.
+'''%(MAX_ACCESS_CODE_LENGTH, MAX_PACKET_LENGTH))
+ def make(fg, type, mod_type, samp_rate, samples_per_symbol,
packet_length, access_code, msgq_limit, pad_for_usrp, use_whitener_offset):
access_code = access_code.parse()
if access_code == '': access_code = None #access code
should be None if blank
- #dummy modulator with access functions
- modulator = gr.skiphead(Byte().get_num_bytes(), 0)
#skip nothing
- modulator.samples_per_symbol = lambda: samps_per_symbol.parse()
- modulator.bits_per_symbol = lambda:
mod_type.parse().bits_per_symbol()
- block = fcn(
+ return PacketModHelper(
fg=fg,
- modulator=modulator,
+ item_size=type.parse().get_num_bytes(),
+ packet_length=packet_length.parse(),
+ samp_rate=samp_rate.parse(),
+ samples_per_symbol=samples_per_symbol.parse(),
+ bits_per_symbol=mod_type.parse().bits_per_symbol(),
access_code=access_code,
msgq_limit=msgq_limit.parse(),
pad_for_usrp=pad_for_usrp.parse(),
use_whitener_offset=use_whitener_offset.parse(),
) #build packet modulator
- setattr(block, packet_attr, packet_mod) #add packet attr
- return block
return sb, make
def PacketDemod(sb):
- fcn = blks.demod_pkts
- sb.add_output_socket('pout', String(), optional=True) #packet
output
+ fcn = blks.demod_pkts
+ type = Enum(all_choices, 1)
+ sb.add_output_socket('out', Variable(type)) #packet output
sb.add_input_socket('in', Byte())
- sb.add_param('Access Code', String('', max=64))
- sb.add_param('Threshold', Int(-1))
+ sb.add_param('Type', type, False, type=True)
+ sb.add_param('Sampling Rate', Float(default_samp_rate))
+ sb.add_param('Access Code', String('', max=MAX_ACCESS_CODE_LENGTH))
+ sb.add_param('Threshold', Int(-1))
+ sb.add_param('Queue Limit', Int(DEFAULT_QUEUE_LIMIT, min=1))
sb.set_docs('''\
-Receive packets from the demodulator.
+The packet demodulator unwraps packets from a data stream.
+---
+Access code/sync vector: string of 1's and 0's between 1 and %d long. Leave
blank for default.
-Access code/sync vector: string of 1's and 0's between 1 and 64 long. Leave
blank for default.
Threshold: detect access_code with up to threshold bits wrong.
-''')
- def make(fg, access_code, threshold):
+
+Queue limit: maximum number of messages in message queue.
+---
+The packet demodulator has a throttle automatically attatched to it at runtime
to save the CPU.
+'''%MAX_ACCESS_CODE_LENGTH)
+ def make(fg, type, samp_rate, access_code, threshold, msgq_limit):
access_code = access_code.parse()
if access_code == '': access_code = None #access code
should be None if blank
- #dummy demodulator
- demodulator = gr.skiphead(Byte().get_num_bytes(), 0)
#skip nothing
- block = fcn(
- fg=fg,
- demodulator=demodulator,
+ return PacketDemodHelper(
+ fg=fg,
+ item_size=type.parse().get_num_bytes(),
+ samp_rate=samp_rate.parse(),
access_code=access_code,
- callback=None, #the callback will be set later
threshold=threshold.parse(),
- ) #build packet demodulator
- setattr(block, packet_attr, packet_demod) #add packet attr
- return block
+ msgq_limit=msgq_limit.parse(),
+ ) #build packet demodulator
return sb, make
-#######################################################################################
-## Stream <-> Packet
-#######################################################################################
-
-def StreamToPacket(sb):
- fcn = gr.message_sink
- type = Enum(all_choices, 1)
- sb.add_input_socket('in', Variable(type))
- sb.add_output_socket('pout', String())
- sb.add_param('Type', type, False, type=True)
- sb.add_param('Message Queue Limit', Int(2, min=1))
- def make(fg, type, msgq_limit):
- msgq = gr.msg_queue(msgq_limit.parse())
- block = gr.message_sink(type.parse().get_num_bytes(), msgq,
True)
- block.msgq = lambda: msgq
- setattr(block, packet_attr, stream_to_packet) #add packet attr
- return block
- return sb, make
-
-def PacketToStream(sb):
- fcn = gr.message_source
- type = Enum(all_choices, 1)
- sb.add_input_socket('pin', String())
- sb.add_output_socket('out', Variable(type)())
- sb.add_param('Type', type, False, type=True)
- sb.add_param('Message Queue Limit', Int(2, min=1))
- def make(fg, type, msgq_limit):
- block = gr.message_sink(type.parse().get_num_bytes(),
msgq_limit.parse())
- setattr(block, packet_attr, packet_to_stream) #add packet attr
- return block
- return sb, make
-
\ No newline at end of file
Modified: grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py
2007-06-17 06:59:13 UTC (rev 5788)
+++ grc/branches/jblum_work/src/SignalBlockDefs/SignalBlockTree.py
2007-06-17 07:13:36 UTC (rev 5789)
@@ -150,6 +150,8 @@
('GMSK Demodulator', Modulators.GMSKDemod),
('QAM Modulator', Modulators.QAMMod),
('QAM Demodulator', Modulators.QAMDemod),
+ ('Packet Modulator', Packet.PacketMod),
+ ('Packet Demodulator', Packet.PacketDemod),
]),
('Coders', [
('Constellation Decoder',
Coders.ConstellationDecoder),
@@ -168,12 +170,6 @@
('Interleaver', Trellis.Interleaver),
('Deinterleaver', Trellis.Deinterleaver),
]),
- ('Packet', [
- ('Packet Modulator', Packet.PacketMod),
- ('Packet Demodulator', Packet.PacketDemod),
- ('Stream to Packet', Packet.StreamToPacket),
- ('Packet to Stream', Packet.PacketToStream),
- ]),
('Misc', [
('Throttle', Misc.Throttle),
('Head', Misc.Head),
Modified: grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py
===================================================================
--- grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py 2007-06-17
06:59:13 UTC (rev 5788)
+++ grc/branches/jblum_work/src/SignalBlockDefs/Sinks.py 2007-06-17
07:13:36 UTC (rev 5789)
@@ -107,7 +107,7 @@
def run(self):
"""
- In a endless while loop: read the vector sink,
+ In an endless while loop: read the vector sink,
write to the variable, and parse the callbacks.
"""
while True:
@@ -142,7 +142,7 @@
sb.add_param('Type', type, False, type=True)
sb.add_param('Variable', VariableKeySelector())
sb.add_param('Samp Rate', Float(default_samp_rate))
- sb.add_param('Message Queue Limit', Int(2, min=1))
+ sb.add_param('Queue Limit', Int(2, min=1))
sb.set_docs('''\
A thread reads a message sink and writes to the variable. \
The variable cannot have a range. \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5789 - in grc/branches/jblum_work: examples examples/audio notes src src/Elements src/Graphics src/SignalBlockDefs,
jblum <=