<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Ham stuff</title>
	<atom:link href="http://villazeebries.krbonne.net/hamstuff/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://villazeebries.krbonne.net/hamstuff</link>
	<description>My live as radio amateur ON1ARF</description>
	<lastBuildDate>Sun, 22 Jan 2012 15:13:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>sparkfun si4735 FM/AM receiver shield</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=139</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=139#comments</comments>
		<pubDate>Sun, 22 Jan 2012 14:34:08 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[remote controlled receiver]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=139</guid>
		<description><![CDATA[Hi, My PC died on me on friday, so no C-development or mailing list discussions this weekend. Well, it can&#8217;t all be about D-STAR and digital voice, and it gives me a little time to play with this: a sparkfun si4735 FM/AM receiver arduino shield. Stereo FM from 76 to 108 Mhz (so including the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>My PC died on me on friday, so no C-development or mailing list discussions this weekend. Well, it can&#8217;t all be about D-STAR and digital voice, and it gives me a little time to play with this: a <a title="sparkfun si4735 AM/FM receiver" href="http://www.sparkfun.com/products/10342" target="_self">sparkfun si4735 FM/AM receive</a>r arduino shield.<span id="more-139"></span></p>
<p>Stereo FM from 76 to 108 Mhz (so including the Japanese FM broadcasting frequencies), RDS and AM continues reception from the longwave band (153 &#8211; 279 Khz) all the way up to the 11 meter broadcasting band (25.67 to 26.1 Mhz), all in one IC!</p>
<p>&nbsp;</p>
<p><a href="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2012/01/IMG189.jpg"><img class="alignnone" title="sparkfun si4735" src="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2012/01/IMG189.jpg" alt="" width="400" /></a></p>
<p>&nbsp;</p>
<p>The idea is to build a remote-controlled receiver for shortwave broadcasting stations, placed in a box at the back of the garden; as far away as possible from interference from the house.</p>
<p>&nbsp;</p>
<p>After a quick test, expected difficulties are:</p>
<ul>
<li>FM works great, but shortwave reception has interference of the arduino</li>
<li>AM longwave and mediumwave use a different antenna (coil) then shortwave and FM (wire antenna). Switching between the antennes is via a hardware switch on the shield; which -of course- cannot be done remotely.</li>
<li>Getting the audio back from the remote receiver into the house. The IC has both an analog and digital output, so some experimenting will be needed to find out what works best.</li>
</ul>
<p>&nbsp;</p>
<p>73</p>
<p>Kristoff &#8211; ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=139</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GMSK software updates: sender alpha 2 and receiver beta2</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=133</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=133#comments</comments>
		<pubDate>Fri, 06 Jan 2012 06:44:57 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[codec2]]></category>
		<category><![CDATA[devboard gmsk modem]]></category>
		<category><![CDATA[dstar]]></category>
		<category><![CDATA[gmsk modem]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=133</guid>
		<description><![CDATA[GSM software updates: sender alpha 2, receiver beta2 Hi, I&#8217;ve pushed an updated of the gmsk software on github. It can be found on its usual address: http://github.com/on1arf. The GMSK sender is now  version alpha2. The last release of the receiver is version beta2. Overall, four things where added: The GMSK sender now has the [...]]]></description>
			<content:encoded><![CDATA[<h2>GSM software updates: sender alpha 2, receiver beta2</h2>
<p>Hi,</p>
<p>I&#8217;ve pushed an updated of the gmsk software on github. It can be found on its usual address: <a href="http://github.com/on1arf">http://github.com/on1arf.</a> The GMSK sender is now  version alpha2. The last release of the receiver is version beta2.</p>
<p>Overall, four things where added:</p>
<ol>
<li>The GMSK sender now has the ability to play out audio directly to an alsa audio device instead of just creating an audio file. This reduces the number of steps needed to send a GMSK stream.</li>
<li>The GMSK sender also added a &#8220;PTT lockfile&#8221; feature. This allows an external application to actually switch the PTT switch of the transceiver.</li>
<li>Both the sender and the receiver now support &#8220;raw&#8221; format files. This enabled the tools to receive or transmit GMSK streams that are not in D-STAR format. (like 4.8 Kbps Digital Data or codec2-based Digital Voice).</li>
<li>The gmsk sender now also accepts input from standard-in. The gmsk receiver now can output the received gmsk stream to standard-out. This makes it easier to use the gmsk tools distributed over seveal devices.</li>
</ol>
<p>&nbsp;</p>
<p><span id="more-133"></span></p>
<p>Next step:</p>
<ul>
<li>Write the applications that switch the PTT, controlled by the gmsk sender module</li>
<li>Write the tools needed to start experimenting with codec2-based gmsk Digital Voice.</li>
</ul>
<p>As usual, discussion about this software prefered on the yahoo <a href="http://groups.yahoo.com/group/gmsk_dv_modem/">gmsk_dv_modem</a> list.</p>
<p>&nbsp;</p>
<p>73</p>
<p>Kristoff &#8211; ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=133</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D-STAR and non-D-STAR GMSK on same frequency ?</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=128</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=128#comments</comments>
		<pubDate>Wed, 14 Dec 2011 09:44:28 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[codec2]]></category>
		<category><![CDATA[devboard gmsk modem]]></category>
		<category><![CDATA[dstar]]></category>
		<category><![CDATA[gmsk modem]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=128</guid>
		<description><![CDATA[D-STAR and non-D-STAR GMSK on the same frequency? With the codec2 vocoder becoming more and powerfull, the possibility of a ham-radio VHF/UHF Digital Voice system using that voice codec is an issue that pops up on different mailing-lists from time to time. On the codec2 mailing-list on sourceforge, an interesting question emerged: if a new [...]]]></description>
			<content:encoded><![CDATA[<h2>D-STAR and non-D-STAR GMSK on the same frequency?</h2>
<p>With the <a href="http://www.rowetel.com/blog/?page_id=452">codec2 vocoder</a> becoming more and powerfull, the possibility of a ham-radio VHF/UHF Digital Voice system using that voice codec is an issue that pops up on different mailing-lists from time to time.</p>
<p>On the <a href="http://sourceforge.net/mailarchive/forum.php?forum_name=freetel-codec2">codec2 mailing-list on sourceforge</a>, an interesting question emerged: if a new GMSK-based ham digital-voice system would be introduced on VHF or UHF, there is a big change that some day, both systems would be used on the same frequency. As codec2 and AMBE -the vocoder used by D-STAR- are completely incompatible, would this not lead to fellow hams getting lots of R2D2 on their D-STAR radio.</p>
<p>Concidering that D-STAR radios have fixed firmware that cannot be changed, how do we make sure that the two systems do not interfere with eachother?</p>
<p>&nbsp;</p>
<p>Or, &#8230;<strong> how does a D-STAR radio react when receiving a non-D-STAR GMSK stream?</strong></p>
<p>Using the new &#8220;gmsk-sender&#8221; application (see <a href="http://villazeebries.krbonne.net/hamstuff/?p=125">earlier blog message</a>) which is able to generate any kind of GMSK-stream, I descided to give this a try.</p>
<p>&nbsp;</p>
<p><span id="more-128"></span></p>
<h4>Test setup:</h4>
<p>Introducing,</p>
<ul>
<li>In the red corner, yaesu FT-857D analog FM radio, interfacing breadboard and a friendlyarm mini2440 running the &#8220;gmsk-sender&#8221; software.</li>
<li>In the blue corner, our &#8220;victim&#8221;, an icom IC-E80D D-STAR handheld radio</li>
<li>Referee: Kenwood TH-F7 analog FM radio, used to detect the presence of a FM carrier.</li>
<li>Place: 430.950 Mhz. Frequency allocated for &#8220;experimenting with DV&#8221; in IARU Region 1.</li>
</ul>
<p><a href="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/12/IMG166.jpg"><img title="The test setup" src="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/12/IMG166.jpg" alt="" width="200" /></a></p>
<h4>The test was pretty simple:</h4>
<ol>
<li>Take a file containing a valid D-STAR stream, containing AMBE-encoded audio and a copy of its D-STAR configuration header in the slow-data part. (icom slowspeed data extension)</li>
<li>Modify the stream according some test criteria.</li>
<li>GMSK-encode the stream, resulting in a PCM audio-file</li>
<li>Play out that audio file using the yaesu FT-857D radio on 430.950 Mhz</li>
<li>Check if the i-com D-STAR plays out the D-STAR conversation; indicating if the radio is able to receive, syncronise and decode the GMSK stream.</li>
</ol>
<h4>Four test-parameters, two senarios.</h4>
<p>To be able to analyse the behaviour of our victim when being bombarded with all these &#8220;non-standard&#8221; GMSK-streams, in total 4 elements where to be examined. The goal is to emulate two different senarios.</p>
<p>&nbsp;</p>
<p>The four elements that are modified in a D-STAR GMSK stream befor transmitting are as follows:</p>
<ol>
<li>The GMSK &#8220;frame syncronisation&#8221; pattern. This pattern is a fixed 15-bit pattern that is located between the &#8220;bit syncronisation&#8221; pattern (in the beginning of the gmsk stream) and the D-STAR configuration frame. It is used to indicate the beginning of the D-STAR information in the GMSK bitpattern.</li>
<li>The D-STAR configuration frame: a 41 octet structure located at the beginning of every D-STAR stream. It contains information like the &#8220;MY&#8221; and &#8220;YOUR&#8221; callsign, repeater callsigns and 3 flags. It also contains a checksum.</li>
<li>The 3-octet syncronisation pattern located in the slow-speed data part of every consequative 21 D-STAR frame.</li>
<li>The copy of the D-STAR configuration frame, as found in the slow-speed data part of a D-STAR stream. This information is only generated by i-com equipement as this is an i-com extension of the D-STAR slow-speed data protocol.</li>
</ol>
<p>For more information on the first three elements, check out the &#8220;what does a D-STAR stream really look like?&#8221; document <a href="http://villazeebries.krbonne.net/hamstuff/?p=106" target="_blank">here</a>.</p>
<p>Information about the i-com extensions for slow-speed data can be found <a title="The Format of D-Star Slow Data Version 0.2" href="http://www.qsl.net/kb9mwr/projects/voip/dstar/Slow%20Data.pdf" target="_blank">here</a></p>
<p>&nbsp;</p>
<p>The two senarios that where emulated are:</p>
<ol>
<li>The i-com radio receiving a GMSK stream from the beginning of the stream.</li>
<li>The i-com radio receiving a GMSK stream NOT from the beginning of the stream.</li>
</ol>
<p>The difference in these senarios is related to the fact that -as mentioned above- two of these test-parameters (&#8220;frame syncronisation&#8221; and &#8220;D-STAR configuration frame&#8221;) are only present in the beginning of the stream. If a radio does not receive (or is unable to decode) these fields, this results in a different outcome of the test.</p>
<p>&nbsp;</p>
<p>In fact, tests shown that if a D-STAR radio DOES receive the beginning of a GMSK stream, but that stream does NOT containing a D-STAR complient frame-syncronisation pattern, is functionally equivalent to having it tune to an frequency with an ongoing D-STAR conversation. The radio needs to try to syncronise itself to the GMSK stream based on the elements in the D-STAR format that are repeated continuesly in the stream: the 3-octet &#8220;resync&#8221; pattern or the slow-speed data part.</p>
<p>&nbsp;</p>
<h4>D-STAR configuration frame</h4>
<p>After some quick first tests, a first conclussion was quickly made: rewriting information in the D-STAR configuration header has absolutely no effect on wether or not the i-com radio plays out a received stream.</p>
<p>No matter what was placed in the &#8220;YOUR&#8221;, &#8220;MY&#8221; or &#8220;REPEATER&#8221; fields, in the flag or if the checksum of the header-field is correct or not, the i-com IC-E80D always played out any stream it receives and can syncronise on.</p>
<p>&nbsp;</p>
<p>One could even ask if this particular firmware in the IC-E80D is actually complient to the JARL D-STAR specification. During one test, the radio was send a stream with these parameters:</p>
<ul>
<li>all syncronisation patterns valid</li>
<li>D-STAR configuration frame modified, setting bit 7 (MSB) of flag 1 to &#8220;1&#8243;</li>
<li>checksum of config frame corrected</li>
<li>no D-STAR configuration information in the slow-data part of the stream</li>
</ul>
<p>According to page 3 of the the &#8220;<a href="http://villazeebries.krbonne.net/files/gmsk/shogen.pdf" target="_blank">shogen</a>&#8221; document of the JARL, bit 7 (MSB) of flag 1 &#8220;<em>Distinguishes between voice and data communications. 1 indicates data, 0 indicates voice</em>&#8220;.</p>
<p>If this is supposted to be a &#8220;data&#8221; stream, a voice D-STAR radio should not try to decode it. Apparently it does as the IC-E80D does play it out. As the checksum of the configuration-frame IS correct, there is no reason why the firmware of the radio should question the validity of the flag and behave accordently.</p>
<p>&nbsp;</p>
<h4>The results:</h4>
<p>In the end, there where three parameters to test:</p>
<ol>
<li>A valid frame syncronisation pattern at the beginning of the stream.</li>
<li>Valid syncronsation octets every 21 digital-voice frames</li>
<li>A copy of the D-STAR configuration frame in the slow-data part of the stream</li>
</ol>
<p>The results of the tests are as follows:</p>
<p>&nbsp;</p>
<table border="1" cellspacing="2" cellpadding="0">
<tbody>
<tr>
<td><strong>Frame sync (BEGIN)</strong></td>
<td><strong>Sync (every 21 frames)</strong></td>
<td><strong>D-STAR config in slow-data</strong></td>
<td><strong>RESULT</strong></td>
</tr>
<tr>
<td>YES</td>
<td>YES</td>
<td>YES</td>
<td>YES</td>
</tr>
<tr>
<td>YES</td>
<td>YES</td>
<td>NO</td>
<td>YES</td>
</tr>
<tr>
<td>YES</td>
<td>NO</td>
<td>YES</td>
<td>YES</td>
</tr>
<tr>
<td>YES</td>
<td>NO</td>
<td>NO</td>
<td>YES (for 2 secs)</td>
</tr>
<tr>
<td>NO</td>
<td>YES</td>
<td>YES</td>
<td>YES (after 2 sec)</td>
</tr>
<tr>
<td>NO</td>
<td>YES</td>
<td>NO</td>
<td>NO</td>
</tr>
<tr>
<td>NO</td>
<td>NO</td>
<td>YES</td>
<td>YES (after 2 sec)</td>
</tr>
<tr>
<td>NO</td>
<td>NO</td>
<td>NO</td>
<td>NO</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>So, what can we conclude from this?</p>
<ul>
<li>If the radio receives a stream from the beginning, it needs either the valid 21-frame sync pattern or a copy of the D-STAR configuration frame in the slow data to syncronise itself. If not, it will stop after about 2 seconds.</li>
<li>If the radio does NOT receive the beginning of a stream, it is able to syncronise to the received stream anyway if it receives a valid copy of the D-STAR configuration of the slow-data. This takes about 2 seconds.</li>
<li>if the radio does NOT receive the beginning of a stream, only receives the 21-frame sync but NO D-STAR-config-in-slowdata, it does NOT play out the stream. This is a bit surprising, concidering the results of the same test in the &#8220;radio is able to receive the beginning of the stream&#8221; senario. Perhaps the radio DOES is able to syncronise itself to the stream but descides not to play it out because it does not have valid D-STAR routing information.</li>
</ul>
<p>Of course, these test are only valid for this particular radio with this particular firmware. More tests would need to be done with other D-STAR radios.</p>
<p>&nbsp;</p>
<h4>D-STAR and non-D-STAR GMSK on the same frequency?</h4>
<p>To go back to the original question, what would be the effects of running a GMSK-based codec2-based digital voice on VHF or UHF? Could this be done without producing a lot of R2D2 on D-STAR radios which happen to be tuned to the same frequency?</p>
<p>&nbsp;</p>
<p>Based on these test with this radio, the conclussion is that it IS possible, providing the following conditions are met:</p>
<ul>
<li>codec2 based GMSK DV does NOT use the same frame-syncronisation pattern in the beginning of the stream</li>
<li>codec2 based GMSK DV does NOT use the same 3-octet syncronisation pattern every 21 frames</li>
<li>codec2 based GMSK DV does NOT use the i-com extension of the slow-data service where the D-STAR header is repeated in slow-speed data part of the stream.</li>
</ul>
<p>&nbsp;</p>
<p>73</p>
<p>Kristoff &#8211; ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>software updates: GSMK receiver, GMSK sender and dstar-sms</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=125</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=125#comments</comments>
		<pubDate>Tue, 13 Dec 2011 18:19:52 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[devboard gmsk modem]]></category>
		<category><![CDATA[dstar]]></category>
		<category><![CDATA[gmsk modem]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=125</guid>
		<description><![CDATA[Software updates: GMSK receiver (beta 1), GMSK sender (alpha 1) and dstarsms &#160; The last weeks and days, I have pushed three software updates on github. As usual, the source-code can be found on https://github.com/on1ARF &#160; GMSK receiver Beta 1. The GSM receiver has moved up from &#8220;alpha&#8221; to &#8220;beta&#8221; phase as it has achieved [...]]]></description>
			<content:encoded><![CDATA[<h2>Software updates:</h2>
<h2>GMSK receiver (beta 1), GMSK sender (alpha 1) and dstarsms</h2>
<p>&nbsp;</p>
<p>The last weeks and days, I have pushed three software updates on github. As usual, the source-code can be found on <a href="https://github.com/on1arf/">https://github.com/on1ARF</a></p>
<p>&nbsp;</p>
<h4>GMSK receiver Beta 1.</h4>
<p>The GSM receiver has moved up from &#8220;alpha&#8221; to &#8220;beta&#8221; phase as it has achieved a certain level of stability.</p>
<p><span id="more-125"></span></p>
<p>Changes compaired to &#8220;alpha3&#8243; are:</p>
<ol>
<li>Better code to deal with unexpected-end-of-stream situations. The program now used the average audio-level of the incoming signal to detect when a stream has ended without sending a proper termination pattern.</li>
<li>Do not do gmskdemodation when no signal is being received. Again, using the average audio-level, the program detects when a stream is being received or not. When no stream is being received, no gmsk decoding is done which largely reduces the CPU usage of the application. On a mini2440, the CPU load has gone down from more then 20 % to less then 2 % when no signal is being received.</li>
<li>Some small bugfixes.</li>
<li>The option to output of the incoming stream to UDP packets on a network.</li>
</ol>
<p>&nbsp;</p>
<p>The ability to stream out a received GMSK stream to UDP packets on the local network has two main applications:</p>
<ul>
<li>To communicate the received data to one or multiple INTERNAL applications on the same board (e.g. AMBE decoder, voip client, &#8230;)</li>
<li>To send the received data to an EXTERNAL application somewhere else on the network. One particular example is setting up a D-STAR repeater with multiple receptions sites; thereby allowing people with handheld radios to transmit at lower power.</li>
</ul>
<p>&nbsp;</p>
<p><strong>GMSK sender alpha 1</strong></p>
<p>A new application is the &#8220;gmsksender&#8221;.</p>
<p>As its name implies, this application does the opposite of the gmsk receiver: it reads a file from a local media and does gmsk modulation, generating a PCM audio-file. That file can then be send to the 9k6 port of a FM-radio, resulting in a GMSK or D-STAR stream that is transmitted.</p>
<p>&nbsp;</p>
<p>This is still &#8220;alpha1&#8243; code, so it does have its limitations:</p>
<ul>
<li>The generated GMSK audio-file is in RAW PCM format. It needs to be converted to a more usefull .WAV file using an external application (sox)</li>
<li>The resulting .wav file needs to be played out to the 9k6 port of the tranceiver using an external application (e.g. aplay, mplayer, &#8230;)</li>
<li>There is currently no way to automatially drive the PTT of the radio. That needs to be done by manually grounding the PTT pin of the 9k6 port of the radio.</li>
</ul>
<p>Althou this tool is still alpha code, it does have some nice features:</p>
<ul>
<li>Rewrite the D-STAR header (MY, YOUR, RPT, &#8230; flags)</li>
<li>Recreate syncronisation patterns in the D-STAR stream</li>
<li>Erase the slowspeed data (which also deletes the copy of the D-STAR header found in the slowspeed data part)</li>
</ul>
<p>&nbsp;</p>
<h4>D-STAR repeater SMS tool</h4>
<p>This is a tool I wrote about a year ago. It is an perl script that allows communication from and to a D-STAR repeater server using SMS text messaging.</p>
<p>&nbsp;</p>
<p>This is a proof of concept of a &#8220;backup communication path&#8221; for D-STAR repeaters when the main internet connection is unavailable. For that, it uses a 3G dongle, althou the SMS texting-service can work both on 2G or 3G networks.</p>
<p>&nbsp;</p>
<p>It provides examples for two possible senarions:</p>
<ul>
<li>Communication from the sysop to the repeater. In this case, the ability to send a Dplus message from the repeater, triggered by a SMS from the sysop.</li>
<li>Communication from the repeater to the sysop, in casu a text-message send by the repeater to the sysop when it notices the repeater controller server has rebooted.</li>
</ul>
<p>The code is designed to be as open as possible so to allow anybody to work with it. It is also designed to work on any linux  or unix based device, including ARM developement board like the mini2440. One application for this is to execute a hardware power-cycle of a repeater, triggered via SMS.</p>
<p>&nbsp;</p>
<p>73</p>
<p>Kristoff  &#8211; ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=125</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does a GMSK D-STAR stream actually look like?</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=106</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=106#comments</comments>
		<pubDate>Fri, 25 Nov 2011 08:29:06 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[devboard gmsk modem]]></category>
		<category><![CDATA[dstar]]></category>
		<category><![CDATA[gmsk modem]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=106</guid>
		<description><![CDATA[It may sound hard to believe but, these days, writing a GMSK receiver is in principe not that hard. All you need to do are these for 4 steps: Capture audio from the radio via the audio-device of the computer GMSK demodulate the audio and turn it into a train of bits Extract the raw [...]]]></description>
			<content:encoded><![CDATA[<p>It may sound hard to believe but, these days, writing a GMSK receiver is in principe not that hard. All you need to do are these for 4 steps:</p>
<ul>
<li>Capture audio from the radio via the audio-device of the computer</li>
<li>GMSK demodulate the audio and turn it into a train of bits</li>
<li>Extract the raw D-STAR stream from that unordered stream of bits</li>
<li>Process some parts of this D-STAR stream for error-correction, descrambling, deinterleaving</li>
</ul>
<p>The end result: a .dvtool file containing a D-STAR stream.</p>
<p>Easy no? <img src='http://villazeebries.krbonne.net/hamstuff/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span id="more-106"></span></p>
<p>The reason I wrote &#8220;these days&#8221; in the sentence above has to do with an evolution on the radio-amateur world that has changed it quite dramatically the last couple of years: open source software. Up to -say- one or two years ago, if you where interested in writing this kind of software (for an end-user application or just to learn more about it) you had to write everything herself. You had to understand everything about all these different aspects, including some quite complicated things, like low-level DSP code for GMSK modulation and demodulation, Forward error correction algorithms). These days, that is not the case anymore.</p>
<h3><span style="text-decoration: underline;">The importance of open source software</span></h3>
<p>There are currently at least two different open-source software projects that implement at least part of a GMSK modem: the PC based <a href="http://groups.yahoo.com/group/pcrepeatercontroller/" target="_blank">pcrepeatercontroler</a> project of Jonathan, G4KLX and the <a href="http://www.dvrptr.de/" target="_blank">DVPRTR</a> project around Jan, DO1FJN, Torsten, DG1HT and DH2YBE who target a &#8220;controller-board&#8221; based solution. The interesting part about open source software is its license: the so-called &#8220;GPL v2&#8243; license. That software license is specifically designed, not only to allow people to reuse programming code written by somebody else in their own projects, but also to learn from it and even to modify it to ones own use.</p>
<p>What does this mean? Well, it means that you do not have to know everything about everything anymore. You can just use existing code, as written by somebody else, and start from there on.</p>
<p>Open source is much more then &#8220;free&#8221; software. By using open source, software and hardware designs become a way to learn. You can just take some project that already works, look how it works, learn from it, think about it, modify it to try out some ideas and even merge your code back into the original project.</p>
<p>Of course, it requires a bit of programmaing skills, but more then half of the work has already been done. This code provides a very solid based to get started and experiment with this or work out your own ideas. This is what this project is about: allow people to learn what a gmsk modem actually does and to allow people to experiment with it.</p>
<h3><span style="text-decoration: underline;">The Basics of GMSK and D-STAR streams</span></h3>
<p>Now, before starting to program anything, the first step is to understand it. For D-STAR, this turns out one of the more difficult hurdles to take. Information about D-STAR is scattered over multiple documents, from different sources, written by different people. Its very easy for somebody new to D-STAR to get overwelmed by all these texts, especially as most of these documents about D-STAR on the internet are not even relevent to building a GMSK receiver.</p>
<p>In this mountain of information, there is one single &#8220;D-STAR specification&#8221; (the &#8220;<a href="http://villazeebries.krbonne.net/files/gmsk/shogen.pdf">shogen</a>&#8221; document, a mere 11 pages) that described the radio level interface of D-STAR. The problem is that it written for people already experienced with this kind of technology. For somebody who is new to this matter, it looks -from one side- quite overwelming and -on the other size- not containing that much usefull information. We will try to provide this information in a more structured way.</p>
<p>Now, there are multiple ways one can describe a D-STAR radio stream: using pure dry specifications, as maths, what is looks like as a radio-frequency signal. The appoach taken in this article is by asking a simple question: &#8220;<em>what does a D-STAR stream look like for a computer program that needs to decode it</em>&#8220;. The goal of this exercise it to give some  insight into what a GMSK audio-stream actually is, how it is structured and -based on that- how does one go about writing software to decode it. It does this by reducing certain &#8220;magical&#8221; parts of the programming code (especially the DSP code to do GMSK demodulation, error-correction and scrambling) to a &#8220;magical box&#8221;. We will gracefully skip over this code in this article.</p>
<p>The programming code for this GMSK receiver application can be found <a href="https://github.com/on1arf/" target="_blank">here</a>.</p>
<p>In the end, believe it or not, it actually turns out that understanding a D-STAR stream isn&#8217;t so difficult to all.</p>
<h3><span style="text-decoration: underline;">10 basic facts</span></h3>
<p>If you search the internet for specifications about D-STAR, you will come across some words and terms that -for people who know digital communication- are common knowledge. These words provide certain basic information that one should be aware of. So, if you bare with me, here are the &#8220;<em>10 basic facts about GMSK and D-STAR you should know and understand</em>&#8220;:</p>
<ol>
<li><strong>Digital</strong>: D-STAR is a digital communication system. This means that speech is not transmitted as a varying analog signal (like FM, AM or SSB) but converted to and transmitted as a serie of 0s and 1s (&#8220;bits&#8221;).</li>
<li><strong>GMSK</strong>: Althou we want to transmit speech as a serie of digital 0s and 1s, we still need to do this using analog radio-equipement. For that reason, the bits are converted into &#8220;tones&#8221; so it can be transmitted over an analog radio. This is the reason why, if you tune a analog FM radio to the frequency of a D-STAR repeater, a D-STAR signal will sound like &#8220;buzzing noises&#8221;. There exist a number of such &#8220;modulation&#8221; systems: FSK, PSK, ASK. The system used by D-STAR is GMSK, a system related to PSK.</li>
<li><strong>FM modulated</strong>: as all HAMs should know, transporting a analog signal with a radio can be done using a number of different modulation technologies: AM, SSB or FM. Just like certain other digital technologies (notebly packetradio and APRS), GMSK uses FM modulation. This explains why it is possible to use a normal FM-transceiver to send and receive GMSK signals.</li>
<li><strong>9k6 data port</strong>: One of the things where a GMSK modem differs from a normal FM voice communication (and from packet-radio and APRS), is that it uses the &#8220;9k6&#8243; dataport to the radio, instead of the normal &#8220;microphone/speaker&#8221; ports. That port is different from the other ports on a FM transceiver that is bypassed the &#8220;emphasis/deemphasis&#8221; circuit of a FM radio. These circuits modify the audio in a way which would change the gmsk &#8220;tones&#8221; and therefore also change the bits they carry. Hence, to avoid this, a gmsk modem is connected to the 9k6 port of a FM transceiver.</li>
<li><strong>4800</strong>: that is the number of bits per second that are send by a D-STAR radio. These bits can be divided into 3 groups: 2400 bits/second &#8220;voice&#8221; information, 1200 bits/second &#8220;forward error correction&#8221; bits, used to protect the voice-information from transmission-errors and correct them if possible, and 1200 bits/second &#8220;slow data&#8221;.</li>
<li><strong>structured</strong>: althou when listening to a gmsk stream one wouldn&#8217;t say it, the bits in a gmsk stream do have a fixed predefined structure. In short, it consists of a header-frame of 328 bits that contain such information like the callsign of the sender and any number of data-frames of 12 octets each that containing digital voice and slow-data.</li>
<li><strong>Syncronisation</strong>: in addition to the structure mentioned above, a D-STAR GMSK stream also contains some special bitsequences that are needed for syncronisation. These are needed so that the receiver listens for bits at exactly the exact time that the transmitter has sended them. Syncronisation bits are used to mark the beginning of the stream (hence located in front of the D-STAR configuration frame), to mark that a stream has ended and also every 21 frames (i.e. every 420 milliseconds) to keep the receiver &#8220;in tempo&#8221; with the sender.</li>
<li><strong>20ms</strong>: A voice communication -which can take up to minutes- cannot be processed at one go by a digital voice system. It is cut into pieces of 20 milliseconds each. This allows the voice to be processed by the &#8220;vocoder&#8221; (see one below) and converted into 9 octets (6 octets voice data + 3 octets error-correction). These 9 octets, plus 3 octets of &#8220;slow-data&#8221; make up the 12 octets that go into every dataframe (see one above).</li>
<li><strong>AMBE</strong>: 20 ms of unprocessed voice information normally takes up 160 octets. To fit it into the 6 octets of voice-data that D-STAR can carry, it needed to converted by a so-called &#8220;codec&#8221; (coder/decoder) or  &#8221;vocoder&#8221; (short for &#8220;voice coder&#8221;). The vocoder used by D-STAR is called &#8220;AMBE&#8221;.</li>
<li><strong>DVdongle</strong>: The GMSK receiver software does not deal with the AMBE vocoder. It just dumps the received stream onto a local file and does not process the voice stream in any way. Software that DO want to encode or decode audio uses an external device for this (called the &#8220;DVdongle&#8221;) as the software that does the conversion from or to the AMBE format is not public and can only be bought in the form of a IC.</li>
</ol>
<h3><span style="text-decoration: underline;">Hardware setup</span></h3>
<p>Software is all nice but, in the end, hardware is always needed to get the received audio into the computer board running the GMSK modem. In this example, the setup is very limited:</p>
<p><a href="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG123b.jpg"><img src="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG123b.jpg" alt="" width="150" height="100" /></a></p>
<p>(click on photo for more details)</p>
<p>These are the hardware components that are used:</p>
<ul>
<li>A FM tranceiver with a 9k6 data-port (in this case, a Yaesu FT-857D)</li>
<li>Any kind of computing-device, either a &#8220;PC&#8221; class computer or developement board (in this photo, I used the pandaboard, but this can also run on less powerfull like the mini2440 also visible in the photo)</li>
<li>Any audio input device, either the native audio-in port of the computer / developement board, or an external USB fob. In this case, <a href="http://www.dealextreme.com/p/c-media-cm108-virtual-7-1-surround-usb-2-0-external-sound-card-with-hardware-volume-control-and-mute-21812" target="_blank">this</a> device was used as these are known to work well. They have been tested quite thoughtly by the people of the <a href="http://www.va3uv.com/freestar.htm">freestar</a> D-STAR network in Canada.</li>
<li>A cable connection the audio input device with the radio. In some cases, a capacitor is needed between the transceiver and the dongle to block the DC component. However, on the Yaesu FT-857D, there already is a capacitor located on the 9k6 port of the radio so there is no capacitor on the connection cable.</li>
</ul>
<p>Note that in this setup, the connection between the radio and the USB audiofob are just two wired that are soldered together and hang freely in the air. This would -of course- not be something you would do in a operational enviroment as this would pick up all kind of RF interference from all kind of sources (like the two development boards and a laptop located closeby).</p>
<p>From an software-development point of view, as programs have to be able to deal with interference and biterrors, this &#8220;bad&#8221; interface actually helps to make the code more robust. A more complete interface circuit can be here, as provided by Ramesh, VA3UV.</p>
<h3><span style="text-decoration: underline;">Step 1: capturing and analysing an audio-stream</span></h3>
<p>As mentioned above, this article looks at a GMSK D-STAR stream, as seen by an computer application that needs to decode it.</p>
<h5>Sample 1:</h5>
<p>So, the first step is &#8230; to do the same thing and listen what the gmsk decoder receives from the radio. Click below to listen to audio sample 1 (6 seconds): 	<audio id="wp_mep_1" src="http://villazeebries.krbonne.net/files/gmsk/audio_1.wav"     controls="controls" preload="none"  >
		
		
		
		
		
		
		
		<object width="400" height="30" type="application/x-shockwave-flash" data="http://villazeebries.krbonne.net/hamstuff/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf">
			<param name="movie" value="http://villazeebries.krbonne.net/hamstuff/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" />
			<param name="flashvars" value="controls=true&amp;file=http://villazeebries.krbonne.net/files/gmsk/audio_1.wav" />			
		</object>		
	</audio>
<script type="text/javascript">
jQuery(document).ready(function($) {
	$('#wp_mep_1').mediaelementplayer({
		m:1
		
		,features: ['playpause','current','progress','duration','volume','tracks','fullscreen']
		,audioWidth:400,audioHeight:30
	});
});
</script>
</p>
<p>So what do we hear? &#8230; Nothing? &#8230; Not really. We DO hear someting: noise!</p>
<p>This is a first interesting fact. When receiving audio from the 9k6 audio receive port of a radio, there is no &#8220;squelch&#8221; function. The reason for that is very simple: the 9k6 &#8220;port of a tranceiver is position BEFORE the FM discriminator while the audio &#8220;squelch&#8221; function is located completely at the end of the audio reception circuit.</p>
<h5>Sample 2:</h5>
<p>Next, audio sample 2 (16 seconds). Click below: 	<audio id="wp_mep_2" src="http://villazeebries.krbonne.net/files/gmsk/audio_2.wav"     controls="controls" preload="none"  >
		
		
		
		
		
		
		
		<object width="400" height="30" type="application/x-shockwave-flash" data="http://villazeebries.krbonne.net/hamstuff/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf">
			<param name="movie" value="http://villazeebries.krbonne.net/hamstuff/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement/flashmediaelement.swf" />
			<param name="flashvars" value="controls=true&amp;file=http://villazeebries.krbonne.net/files/gmsk/audio_2.wav" />			
		</object>		
	</audio>
<script type="text/javascript">
jQuery(document).ready(function($) {
	$('#wp_mep_2').mediaelementplayer({
		m:1
		
		,features: ['playpause','current','progress','duration','volume','tracks','fullscreen']
		,audioWidth:400,audioHeight:30
	});
});
</script>
</p>
<p>As one can hear, this audio-sample contains two gmsk burst, surrounded by noise. As the saying goes &#8220;a picture shows more then a thousand words&#8221;, this is the actual visual dump of this audio-file, as generated by the audio editor Audicity.</p>
<p>(click for a bigger image)   <a href="http://villazeebries.krbonne.net/files/gmsk/audio2_1.png"><img src="http://villazeebries.krbonne.net/files/gmsk/audio2_1.png" alt="" height="100" /></a></p>
<p>So, again, we have the same things:</p>
<ul>
<li>Two &#8220;bulb&#8221; of GMSK streams</li>
<li>Surrounded by noise when nothing is being received.</li>
</ul>
<p>Another interesting fact is the audio-level of the received noise, when no FM signal is being received, is actually higher then there is a valid signal entering the FM receiver circuit.</p>
<h5><span style="text-decoration: underline;">A close-up of the beginning of the stream</span></h5>
<p>Let&#8217;s make a close ups of one of the gmsk bursts in the stream. As shown on the timescale, this is the beginning of the 2nd gmsk burst. See image below:   <a href="http://villazeebries.krbonne.net/files/gmsk/audio2_2.png"><img src="http://villazeebries.krbonne.net/files/gmsk/audio2_2.png" alt="" height="100" /></a></p>
<p>Visually, it is very easy to distinguish three different parts.</p>
<ol>
<li>Up to marker 7.985, no signal is being received, so the radio is picking up noise.</li>
<li>Between 7.990 and 8.105, we see a very regular pattern</li>
<li>From 8.195 onwards, this pattern becomes much more varied.</li>
</ol>
<p>The explanation for this can be found in the 6th and 7th &#8220;basic fact&#8221; mentioned above. A D-STAR stream is not just a random stream of bits, it has a fixed structure. In particular, in front of the D-STAR stream itself, there is a fixed &#8220;syncronisation pattern&#8221; which marks the start of the stream. This patterns is not only fixed, it&#8217;s also very regular.</p>
<p>Another nice element in this audio-sample is the small &#8220;hick up&#8221; just at the beginning of the syncronisation pattern (around timestamp 7.990). The reason for it is currently not completely clear and discussions in our local radio-club center around either the behaviour of the VFO PLL circuit of the FM receiver and the effect of capacitors in the audio-ports of the receiver and the USB audiofob.</p>
<h5><span style="text-decoration: underline;">Demodulated signal of the beginning of a stream</span></h5>
<p>Now, as a good journalist, one needs to have at least two independant sources to trust a story. So what does it actually look like when we GMSK demodulate this audio-stream? As the &#8220;gmsk receiver&#8221; has an option &#8220;-dd&#8221; (dump more), it is possible to see what the program actually sees coming in.</p>
<p>The process that creates this bittrain goes like this:</p>
<ol>
<li>The application captures an audio sample every 1/48000 second</li>
<li>The value of that sample is send to the &#8220;gmsk demodulate function&#8221; (one of the &#8220;magical&#8221; pieces of code) which turns this into a &#8220;0&#8243; or a &#8220;1&#8243;</li>
<li>As we are sampling 48,000 samples per second but the gmsk signal only runs at 4,800 bits per second (one tenth of the sampling rate), some additional code is needed to take care of this. Again, we will concider this code is a &#8220;magic box&#8221; that we will accept &#8220;as it&#8221;.</li>
</ol>
<p>So, back to the audio-sample. Let&#8217;s GMSK demodulate it and see what we get. First up, demodulation of the noise. This is the result:
<pre>
00111000 10011100 00000010 00001000 00110111 11011111
00000000 10000001 00000000 00101101 10011111 10111111
11000001 11010010 01111010 01100001 00101000 00110100
00000000 01110100 10011010 00110000 00011000 10011011
00011101 10000111 10000111 11100111 10100011 11110101
11100000 11110000 11100110 11000001 01111101 10100001
(...)</pre>
<p>&nbsp;</p>
<p>(Note that the grouping of the bits in groups of 8 is just to make things a bit more readable, it has no special meaning).</p>
<p>Conclussion: as noise is in fact nothing else then a bunch or random voltage levels, turning this into a bitstream of 0s and 1s just produces a random string of 0s and 1s. OK, so far, nothing world shocking.</p>
<p>But then, a bit further, things do get more interesting.</p>
<pre>(...)
10000110 00010000 00000001 00010111 11010110 10010100
00111111 10100111 00100011 00111101 00111100 10111111
11101000 10000001 11111101 11101010 11101101 10111111
00010000 11101011 11110000 00000000 11111110 10000000
00001000 11000001 01111100 11111000 10111101 11111111
11111100 00011111 11111111 11111111 11111111 11111111
11111111 11111111 11111111 11111111 11111111 11111111
11111111 11011101 01111101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 01010101
01010101 01010101 01010101 01010101 01010101 010
... 11101 10010100 00</pre>
<p>&nbsp;</p>
<p>As we can see, at a certain moment, a fixed patterns starts to emerge: first all &#8220;1&#8243; and then a repetitions of &#8220;1010&#8243;. Let&#8217;s look in the specification what this means. See page 3 of the &#8220;<a href="http://villazeebries.krbonne.net/files/gmsk/shogen.pdf" target="_blank">shogen</a>&#8221; document:
<pre>
2.1 Wireless Communication Packet
2.1.1 Frame structure of a packet: The explanation of the data frame structure the Radio Header follows.
(1) Bit Syn. (Bit synchronization): Repeated standard 64-bit synchronization pattern (for GMSK 1010). (...)</pre>
<p>&nbsp;</p>
<p>So, what we are seeing here, is the beginning of a D-STAR stream: at first, the receiver and the gmsk needed some time to syncronise themselfs, but after about 20 ms, the fixed &#8220;1010&#8243; appears.</p>
<p>This is not only exactly as the specifications say how it should be, it also corresponds nicely with the audio-sample. As every line in the bitdump above corresponds to 20 ms, the whole process of syncronisation takes about 120 ms (6 lines) which is also shown in the dump of the audio file. Additional proof found!</p>
<p>So, what&#8217;s next? Well, let&#8217;s again have a look at the specification:
<pre>
2.1 Wireless Communication Packet
2.1.1 Frame structure of a packet: The explanation of the data frame structure the Radio Header follows.
(...)
(2) Frame Syn. (Frame synchronization) : 15bit pattern (111011001010000).
(...)</pre>
<p>&nbsp;</p>
<p>Looking again at the bitdump, this 15 bit &#8220;frame sync&#8221; patterhn is exactly what we see at the end!!!</p>
<p>This &#8220;frame sync&#8221; bitpattern is nothing else then a marker in the frame-structure saying &#8220;here stops the bit syncronisation and starts the next part: the D-STAR header frame&#8221;.</p>
<h5><span style="text-decoration: underline;">The D-STAR header</span></h5>
<p>As the specification says, the parts following the frame syn pattern is the D-STAR header frame. Let&#8217;s have a look at the output of the GMSK demodulator. It returns this information:
<pre>
HEADER DUMP:
FLAG1: 00 - FLAG2: 00 - FLAG3: 00
RPT 2: DIRECT
RPT 1: DIRECT
YOUR : CQCQCQ
MY : ON1ARF /KRIS
Check sum = E441 (OK)</pre>
<p>&nbsp;</p>
<p>As one might see, this is just the same information that one has to fill in into a D-STAR transceiver, plus 3 &#8220;flag&#8221; octets and a 2 octet checksum.</p>
<p>Based on this, one would say that the header would have a length of 328 bits (41 octets * 8), however that is not the case. The header is no less then 660 bits. To understand the reason for this, we will have a look at the (simplified) source-code of the gmsk decoder.</p>
<p>In the programming code processing the 660 bits received after the frame-sync sequence, we find this:
<pre>
scramble(radioheaderbuffer_in,radioheaderbuffer_temp1);
deinterleave(radioheaderbuffer_temp1,radioheaderbuffer_temp2);
length=FECdecoder(radioheaderbuffer_temp3,radioheaderbuffer_out);</pre>
<p>&nbsp;</p>
<p>The received header bits are processed by 3 different functions: scrambling, deinterleaving and FECdecoding. Explaining the reason for this is however more easy if we look at what happens at the opposite side, at the transmitter. Overthere, we see the same processes, but in reverse order: first FECencoding, then interleaving and finally scrambling.</p>
<p>As is explained below, these three processes are there to make the transmission of the header more robust, i.e. to make them better capable to deal with packet loss.</p>
<h6>Step 0: adding two bits</h6>
<p>The very first step in this process is a bit strange. Before processing, two bits (containing 0) are added at the end of the 328 bits of the header. These bits do actually not have any particalur use (hence &#8220;step 0&#8243;), They do increase the header-size from 328 to 330 bits.</p>
<p>&nbsp;</p>
<h6>Step 1: FEC</h6>
<p>The first real step in processing the header on the sender side is &#8220;FECencoding&#8221;. FEC means &#8220;Forward Error Correction&#8221; and it does just as its name implies. It makes a stream better able to deal with errors, even BEFORE transmitting it.</p>
<p>The idea is very simple. By adding bits to the stream that is being send,  when bits get corrupted during the transmission, the receiver (actually the FECdecoding algorithm in the receiver software) can use these additional &#8220;error correction&#8221; bits to correct the faulty ones. How FEC really works internally is something will we gracefull pass over in this article.</p>
<p>What is interesting to know is that the particular system used in the D-STAR header creates one additional bit for every data bit; hence doubling the size of the header from 330 to 660 bits.</p>
<h6>Step 2: interleaving</h6>
<p>The second step is a process called &#8220;interleaving&#8221;, which is just a fancy word for &#8220;juggling bits around&#8221;. This means that you complety change the order in which the bits are transmitted. If the header would be only 4 bits, instead of sending the bits as &#8220;1 &#8211; 2 &#8211; 3 &#8211; 4&#8243;, they would be send as &#8220;1 &#8211; 3 &#8211; 2 &#8211; 4&#8243;. This may look like a very odd thing to do, but there actually is a very good reason for this. It is related to the Forward Error Correction mechanism described above.</p>
<p>As mentioned above, the FEC algorith tries to make a stream more robust by adding error-correction bits to the stream. However, these error-correction bits are located just next the data-bit. In our 4-bit header example, bits 1 and 2 form one FEC pair and so would bits 3 and 4.</p>
<p>Now, all these 4 bits are send sequencially. image that, during transmission, there is a interference pulse that not only wipes out bit 1 but also bit 2, both bits of the FEC pair will be corrupted and the FEC system will not able to correct this. This is where the &#8220;interleaving&#8221; system comes it. By spreading out the 660 bits of the header, this makes it less vulnerable to these kind of &#8220;impulse noise&#8221; interference. The bits of the FEC pair are located much more appart.</p>
<p>Programming-wize, interleaving is very easy to implement with just a plain lookup table.</p>
<h6>Step 3: scrambling</h6>
<p>Althou the name might indicate otherwize, scrambling has nothing to do with encryption. This process -also known as randomizing- is related to how datacommunications systems keep themselfs syncronised.</p>
<p>GMSK demodulation use the timing of the transitions from 0 to 1 and from 1 to 0 to keep the receiving GMSK demodulation process in sync with the sender. These exact timestamps are used as markers to avoid the GMSK receiver losing sync. For that reason, long sequences of all-0 or all-1 are something that need to be avoided.</p>
<p>What the scrambling-process does is convert a bit-sequence into another (predetermined) sequence, making these all-0&#8242;s and all-1&#8242;s less lickely. Luckely, there are open source software-modules to implement scrambling so we do not need to worry to much about it.</p>
<p>Note the the scrambling-process on the server side is exactly the same in the receiver. There does not exist a seperate &#8220;unscrambling&#8221; function.</p>
<p><strong>So, to summarize</strong>:</p>
<ol>
<li>The D-STAR header frame contains the information like callsigns, that are needed for routing a D-STAR stream.</li>
<li>To make it less prone to transmission errors, three processes are applied to it, resulting in a structure that is twice its original size</li>
<li>Luckely, there exist open source software for these functions, so we can just concider this as a &#8220;magical black box&#8221;</li>
<li>At 4800 bits per second, ransmitting the header takes 137.5 ms.</li>
</ol>
<h5><span style="text-decoration: underline;">Finally, voice</span></h5>
<p>Let&#8217;s look at the <a href="http://villazeebries.krbonne.net/files/gmsk/shogen.pdf" target="_blank">specification</a> what is next. Page 5 provides the answer: a sequence of the voice and slow-data information.</p>
<p>The structure of this part of the stream is very simple. Every 20 ms, there 96 bits (12 octets) are send:</p>
<ul>
<li>72 bits (9 octets) of AMBE encoded voice</li>
<li>24 bits (3 octets) of slow-data</li>
</ul>
<p>Looking at the bitstream dump, there is not that much to see at first sight:
<pre>
11011111 11010000 00011000 00011001 11100110 10010100
10110111 11111111 10011101 10101010 10110100 01101000

01111101 01010000 01100000 00011111 10100100 11011100
10001001 01100010 10100111 00001100 00100000 10000011

01011111 10010001 01010000 00000011 10100100 11111100
10011111 11100000 10100101 10011100 00111000 11100011

(...)</pre>
<p>&nbsp;</p>
<p>Every line (containing 12 octets) represents 20 ms. The left 9 octets contain the digital voice + FEC. The right 3 octets contain slow-data.</p>
<p>Concerning slow data, two things need to be noted:</p>
<ul>
<li>The 3 octets of slow data of the first frame and every 21 consequative frame do not contain slow-data. Instead, they contain a fixed pattern (10101010 10110100 01101000), as seen in the example above. This pattern is an additional syncronisation pattern that is used to keep the receiver in sync with the sender. This will be explained more in detail in a later article.</li>
<li>The slow-data found in the other frames are processed by the same scrambling process as used on the header frame. Again, the goal is to avoid long all-1 and all-0 sequences that would risk upsetting the syncronisation of the GMSK demodulator.</li>
</ul>
<h5><span style="text-decoration: underline;">The end</span></h5>
<p>After the header of the voice stream and the actual voice and slow-data frames, we arrive at the last part of the stream: the end.</p>
<p>One of the advantages of a digital telecommunication stream is that you can actually mark the end of a stream INSIDE the stream. You do not have to depend on some carrier dropping away. By saying &#8220;the stream stops here&#8221;, this allows the stream to be terminated much more correct.</p>
<p>Again, let&#8217;s look at the <a href="http://villazeebries.krbonne.net/files/gmsk/shogen.pdf" target="_blank">specification</a> and see what it says. At page 6 of the document, we read this:</p>
<pre>"The last data frame, which requires a means of terminating the transmission, is a unique synchronizing signal (32 bit + 15bit “000100110101111” + “0”, making 48 bits) as defined by the modulation type.".</pre>
<p>&nbsp;</p>
<p>Hum!  Interesting wording! <img src='http://villazeebries.krbonne.net/hamstuff/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>Looking at the simplified source-code, we see that this &#8220;unique syncronisation signal&#8221;  is equivalent to the following bitpattern:</p>
<ul>
<li>The last 3 octets of a frame contain the pattern &#8220;10101010 10101010 10101010&#8243;</li>
<li>The first 3 octets of the next frame contain the pattern 10101010 00010011 01011110&#8243;</li>
</ul>
<p>Again, we look at the output of the gmsk receiver program, and we see this:
<pre>
11011001 10110000 00101101 00001101 11000011 11000110
00111111 01100110 01010110 10000100 00110000 01000011

00111011 10010011 00000101 10001000 01101011 01111111
11110001 11001100 10010111 11111110 10101010 10101010

10101010 00010011 01011110 END.</pre>
<p>&nbsp;</p>
<p>Now, if you look at this carefully, you see that the pattern does not completly match. The 10th octet of the last full frame should contain &#8220;10101010&#8243; but it contains something else. However, that pattern is still correctly seen as a valid &#8220;END&#8221; marker by the functions that have to detect an end of a stream.</p>
<p>The reason is that these functions are coded in such a way that it can deal with small errors. In this case, it allows up to 3 bit errors. If this would not be done, a single biterror in the transmission of the &#8220;end&#8221; marker would risk the receiver completely missing the end of the stream.</p>
<p>The picture below shows this pattern, as it was received by the board:</p>
<p><a href="http://villazeebries.krbonne.net/files/gmsk/audio2_3.png"><img src="http://villazeebries.krbonne.net/files/gmsk/audio2_3.png" alt="" height="100" /></a></p>
<p>The end-sequence pattern can be found between timestamp 11.844 and 11.850 (with the 16-times &#8220;01&#8243; nicely showing up). And it even shows why the beginning of this patterns was incorrectly decoded: there seams to be some drift on the signal.</p>
<p>This shows one of main difficulties with programming a GMSK receiver: making it work correctly, even if the stream contains biterrors. But that is a subject that will discussed in a later article.</p>
<p>&nbsp;</p>
<p>This finished this article on the structure of a D-STAR stream. I hope that it has been a little bit instructive.</p>
<p>If you have any questions or remarks, discussions about this subject can be best done on the <a href="http://groups.yahoo.com/group/gmsk_dv_modem/" target="_blank">gmsk_dv_modem</a> group on yahoo. Feel free to drop by!</p>
<p>73</p>
<p>Kristoff &#8211; ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=106</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://villazeebries.krbonne.net/files/gmsk/audio_1.wav" length="636044" type="audio/wav" />
<enclosure url="http://villazeebries.krbonne.net/files/gmsk/audio_2.wav" length="1620044" type="audio/wav" />
		</item>
		<item>
		<title>specification original HF Digital Voice G4GUO</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=98</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=98#comments</comments>
		<pubDate>Tue, 22 Nov 2011 17:24:10 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[HF Digital Voice]]></category>
		<category><![CDATA[Digital Voice]]></category>
		<category><![CDATA[G4GUO]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=98</guid>
		<description><![CDATA[Hi, &#160; After a discussion on HF digital voice and the AOR ARD9000 modem in the &#8220;digitalradio&#8221; group on googlegroups I descided to do a little bit of research on this mode. According this information on hamuniverse, this modem is based on a &#8220;open&#8221; standard, developed by Charles, G4GUO, but the specification itself turned out [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>&nbsp;</p>
<p>After a discussion on HF digital voice and the AOR <a href="http://www.aorusa.com/others/ard9000mk2.html" target="_blank">ARD9000</a> modem in the <a href="https://groups.google.com/forum/#!forum/digitalvoice" target="_self">&#8220;digitalradio&#8221; group on googlegroups</a> I descided to do a little bit of research on this mode.</p>
<p>According this information on <a href="http://www.hamuniverse.com/aorard9000.html" target="_blank">hamuniverse</a>, this modem is based on a &#8220;open&#8221; standard, developed by Charles, G4GUO, but the specification itself turned out to be more difficult to locate. So I contacted him for more information.</p>
<p>&nbsp;</p>
<p>This is the information that emerged from the following email conversation:</p>
<ul>
<li>In contrast to what is found on the hamuniverse website, the AOR ARD9000 modem is only &#8220;vagely based&#8221; on the work of Charles</li>
<li>The original specification of the DV system designed by Charles has been lost, but after some work, he did manage to recuperate a part of it. (be it in text-form)</li>
</ul>
<p>As Charles is now mainly working on ATV (check out his <a href="http://g4guo.blogspot.com/" target="_blank">blog</a>) and has no time anymore to work on this, I got permission from him to republish the original specification.</p>
<p>You can find it the document <a href="http://villazeebries.krbonne.net/hamstuff/?page_id=86" target="_blank">here</a>.</p>
<p>&nbsp;</p>
<p>Charles as has also provided source-code of a modem to implement this protocol (assembler code for the motorolla 56K DSP CPU), which may be redistributed as open source.</p>
<p>However, a small part of the code is covered by a copyright of a 3th party. To be sure that no Intellectual Property issues will arrize in a later stage, this issue needs to be &#8220;cleared up&#8221; beforehand. If needed, that small part of code (Fast Fourier Transform) will be excluded.</p>
<p>&nbsp;</p>
<p>73</p>
<p>Kristoff &#8211; ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=98</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using a ARM development board as GMSK/D-STAR modem</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=28</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=28#comments</comments>
		<pubDate>Wed, 16 Nov 2011 20:32:45 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[devboard gmsk modem]]></category>
		<category><![CDATA[development boards]]></category>
		<category><![CDATA[gmsk]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=28</guid>
		<description><![CDATA[A couple of weeks ago, I started a small project to experiment with using a ARM development board as GMSK modem, the basis for any D-STAR system. Using a simple FM tranceiver with a &#8220;9k6&#8243; data port and a USB sound-dongle, these boards can be used to receive a D-STAR compatible GMSK signal. Transmitting a [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago, I started a small project to experiment with using a ARM development board as GMSK modem, the basis for any D-STAR system. Using a simple FM tranceiver with a &#8220;9k6&#8243; data port and a USB sound-dongle, these boards can be used to receive a D-STAR compatible GMSK signal. Transmitting a GMSK signal will be added later.</p>
<p>At this time of writing, there is &#8220;alpha&#8221; code running that turns these boards into a D-STAR receiver and write the received data to a file. (see photo below):<br />
<a href="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG125b.jpg"><br />
<img title="GMSK receiver on ARM board receiving D-STAR stream" src="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG125b.jpg" alt="" width="150" /></a><br />
This article is the first in a series that describes the software and hardware developements in this project.</p>
<p><span id="more-28"></span></p>
<h3>About Development Boards</h3>
<p>In the last years, two new kinds of technology have made their way into our life, one quite openly and one allmost unnoticed.</p>
<p>First, smartphones, tablet computers and all kind of &#8220;mobile computing devices&#8221; have become a common view at home, in the office, in schools and everywhere inbetween. At the same time, all kind of &#8220;smart networking devices&#8221; have appeared in our homes: digital media players and television set-top-boxed connected to our TV, internet streaming-radio in our living-room, a Network Attached Storage holding all our photos or used as &#8220;backup&#8221; for all our computers, intelligent routers, firewalls and wifi basestation, etc. etc.</p>
<p>Althou these two classes of devices pay look quite different, they have two elements on common:</p>
<p>- all of them are in fact small computers in their own right</p>
<p>- all of them have started their life as a so-called &#8220;development board&#8221;. small standalone computers that act as systems to .. well .. as its name implies .. develop and create new devices.</p>
<p>As a side-product of this evolution, a number of these development boards have now become available as standalone products by themselfs. Examples are the beagleboard, the pandaboard, the hawkboard, the friendlyarm, the foxboard and others.</p>
<p>These boards not only provide quite a lot of CPU power for a very low price; their ability to run free and powerfull kernels and Operating Systems, the myriad of free software tools and their opensource hardware license have made these boards an ideal platform for anybody interested in creating computer-driven project.</p>
<p>This blog is about how to use these boards for HAM-related projects, in the first face, as a GMSK modem. The goal is be use this later as the basis for a standalone D-STAR terminal.</p>
<h3>The FriendlyARM mini2440 and the pandaboard:</h3>
<p>The idea to use a ARM developement board for a ham project emerged from a brainstorming session in our local radio club here in Ostend. We where planning our new 6 meter repeater which would consis of two sites: one where the receiver would be located and one for the transmittor. Where looking at possible ways to transport voice from the receiver site to the sender site.</p>
<p>One of the ideas was &#8220;why not send it over some kind of ethernet or IP connection&#8221;. Looking at this, we needed a device that, on one side, captures audio and encapsulates it in a ethernet or UDP frame. On the other side, we needed a second box to do the inverse process: receive a IP packet, extract the audio packet and play it out.</p>
<p>Of course, we could do this with a cheap 2nd hand computer, but because PCs have mechanical components that have the tendency to break (read: disks) and to avoid heating issues in one of the sites; this is something we wanted to avoid.</p>
<p>In short, we where looking for some kind of device, more powerfull the &#8220;controller&#8221; like processor-boards (PIC, arduino, MBED) but cheaper and smaller then a &#8220;low-end PCs&#8221; (plugcomputers or ALIX computer). It turned out that the these ARM developement boards do just that.</p>
<p>Finaly, two boards where chosen: the friendlyarm mini2440 and a pandaboard. (see picture 1: the Friendlyarm mini2440 (left) and the pandaboard (right) brotherly next to eachother in my shack):</p>
<p><a href="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG126b.jpg"><br />
<img title="Friendlyarm mini2440 and pandaboard" src="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG126b.jpg" alt="" width="150" /></a></p>
<p>The specification of these boards is as follows:</p>
<h4>Friendlyarm mini2440:</h4>
<ul>
<li>400 Mhz Samsung 3S2440 CPU, based on a ARM920T core</li>
<li>64 MByte RAM, 1 GB onboard flash</li>
<li>SD slot</li>
<li>3 serial ports (1 * RS232, 2 * TTL)</li>
<li>1 USB host port</li>
<li>GPIO port</li>
<li>JTAG inline debug port</li>
<li>Wired ethernet port</li>
<li>I²C port and SPI port to interface with external ICs</li>
<li>Audio in, Audio out and build in microphone</li>
<li>3.5 inch colour touch-screen LCD display</li>
<li>Camera port (Camera not provided)</li>
<li>Consumes very little power: less then 1 Watt without LCD display; less then 2 Watt with LCD display active.</li>
<li>Runs different versions of linux, android and WinCE</li>
<li>Fully hardware documented</li>
</ul>
<p>This boars is on the low end of the scale what is currently available as ARM-based developement board. It can be purchased via ebay from a number of source (most of them in Asia) for less then 100 euro, including all cables and powersupply. It is marketed as a &#8220;development platform for mobile phones&#8221;.</p>
<p>More information about this board can be found via this <a title="friendlyarm mini2440 overview" href="link" target="_blank">link</a></p>
<p><a href="http://www.friendlyarm.net/products/mini2440"><img src="http://friendlyarm.net/sites/products/mini2440_3.jpg" alt="" width="150" height="100" /></a></p>
<h4>The pandaboard</h4>
<p>The pandaboard is a quite a different beast. It specifications are as follows:</p>
<ul>
<li>TI OMAP4430 processor, containing a 1 Ghz dual-core ARM Cortex A9 + additional onboard DSP-processor to offload audio and video encoding / decoding from the main CPU + 3D video processor</li>
<li>1 GB RAM, no onboard flash</li>
<li>SD slot for external flashcard</li>
<li>2 USB host interfaces + 1 USB-on-the-go interface</li>
<li>wired ethernet</li>
<li>wifi + Bluetooth onboard</li>
<li>analog audio in / audio out</li>
<li>HDMI and DVI interface + HDMI audio out</li>
<li>JTAG inline debugging port</li>
<li>I²C connectivity</li>
<li>LCD port (LCD display not provided)</li>
<li>Camera port (camera not provided)</li>
<li>Runs different kinds of linux or android</li>
<li>open source hardware licensed</li>
</ul>
<p>As seen, this board is more geared towards video and heavy CPU and DSP-oriented operations. It is even able to do full HD video-playback at 1080i. It&#8217;s current price is 174 USD. Note that this does not included cables or powersupply.</p>
<p>More information can be found it the <a href="http://www.pandaboard.org/" target="_blank">pandaboard.org</a> website</p>
<p><a href="http://pandaboard.org/content/platform"><img src="http://pandaboard.org/sites/default/files/PandaBoard_v2.png" alt="" width="150" height="100" /></a></p>
<p>&nbsp;</p>
<p>In the mean time, a new generation of pandaboard has been announced: the pandaboard ES. For more info, click <a href="http://pandaboard.org/content/pandaboard-es" target="_blank">here</a></p>
<h3>Using Development boards for a HAM related project</h3>
<p>Looking at the technical specifcation of these boards, it became pretty obvious that using them for just sampling an audio-sample from an analog port and sending it over an IP connection -the original reason we started looking at these boards- would be a great &#8230; euh .. suboptimal usage of their capacity.</p>
<p>Based on their specifications and information found about other projects on the internet, these boards can be used for quite a number of HAM related projects:</p>
<ul>
<li>packet radio and APRS node</li>
<li>D-STAR gmsk modem, including for D-RATS and D-APRS</li>
<li>Repeater controller</li>
<li>Voip (echolink, IRLP) controller</li>
<li>parrot controller</li>
<li>As &#8220;calculation backend&#8221; for DSP intensive projects (like a SDR radio)</li>
<li>APRS node to distribute weather information</li>
</ul>
<p>Especially the fact that these boards are easily expandable provide a number of interesting options:</p>
<ul>
<li>The ethernet interfaces (wired and wireless) allow these boards to become part of a network. E.g. for D-RATS functionality, it allows computers on the network to &#8220;drop off&#8221; files on the board and have to transmitted over a D-STAR network using D-RATS automatically by the board.</li>
<li>The bluetooth interfaces provide interfacing with external devices, like GPS devices (usefull for APRS and D-APRS)</li>
<li>The USB interfaces give these boards options to add other interfaces not yet present (e.g. GPRS/UMTS, Zigbee, &#8230;)</li>
<li>The serial ports are a cheap and easy option to communicate with devices like the arduino.</li>
<li>That same serial port can also be used to communicate with a transceiver via its CAT-interface</li>
<li>The LCD touch-screen of the mini2440 provide an easy interface for user intaction</li>
<li>The low power consumption mean that this boards can run on batteries for a very long time.</li>
</ul>
<p>In addition to these hardware interfaces, the fact that these boards run a powerfull linux kernel and Operating System also provides a number of software advantages:</p>
<ul>
<li>As expected, the linux kernel provides standard support for all devices found on this boards</li>
<li>In addition to this, almost all external devices that can be used on the USB ports are also supported by the kernel or can be included in the kernel</li>
<li>The linux Operationg System provide all kinds of tools to manage and control the hardware interfaces of the system</li>
<li>As linux is also used on all kinds of other embedded devices, there are a large number of free and open source developement tools for this platform</li>
<li>As these boards are source-code compatible with their big PC counterparts, opensource software for these platforms can be ported to the ARM boards with very little or no modification.</li>
</ul>
<h3>Using a ARM development board as GMSK modem</h3>
<p><a href="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG123b.jpg"><br />
<img title="Very basic hardware setup for gmsk receiver on pandaboard" src="http://villazeebries.krbonne.net/wp-uploads/ganymedes/2011/11/IMG123b.jpg" alt="" width="150" /></a></p>
<p>As a first ham related project on a ARM developement board, I&#8217;ve started a software project to create a GMSK modem. This program is designed to work on any board from the mini2440 upwards. In the photo above, you can see it operational on the pandaboard as GMSK receiver.</p>
<p>Some information about it:</p>
<ul>
<li>The hardware requirements are as follows:
<ol>
<li dir="ltr">A development board, as mentioned above, or any PC running linux.</li>
<li dir="ltr">A USB &#8220;audio&#8221; fob</li>
<li dir="ltr">A FM tranceiver with a &#8220;9k6&#8243; dataport.</li>
</ol>
</li>
<li>The technical setup for the interconnection to the tranceiver can be found at the website of the <a href="http://www.va3uv.com/freestar.htm" target="_blank">freestar </a>project.</li>
<li>In my case, the connection is just a simple wire which have been soldered together. This is not what one would use in an &#8220;operational&#8221; setup as this will is very prune to interference. However, from a &#8220;developement&#8221; point of view, this is usefull to emulate bad quality radio-connections; something software needs to deal with.</li>
<li>The current application is a GMSK D-STAR receiver. This means it receives a incoming D-STAR stream from the radio, demodulates and decodes it and stores in as a file on the development board.</li>
<li>Parts of the code used in this project (especially &#8220;low-level&#8221; code for GMSK demodulation and decoding) comes from the &#8220;pcrepeatercontroller&#8221; project of Jonathan G4KLX. Some code did need to be adapted to make it work fast enough on the &#8220;mini2440&#8243; board, as the CPU of this board does not have a FPU (Floating Point Unit).</li>
<li>The code is open source and is currently in &#8220;alpha&#8221; stage. It is posted on github and can be downloaded via can be downloaded <a href="https://github.com/on1arf/" target="_blank">this </a>link.</li>
</ul>
<p>As mentioned, this is the first article in a series about this project. Other articles will be added soon.</p>
<p>73s</p>
<p>Kristoff &#8211; ON1ARF</p>
<p>16 November 2011</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=28</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>change URLs NOAA weather messages</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=21</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=21#comments</comments>
		<pubDate>Sat, 21 May 2011 07:39:29 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[dstar]]></category>
		<category><![CDATA[voice-announcements]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=21</guid>
		<description><![CDATA[Hi, Ken, KE2N, has rapported that the URLs for the audio-files of the NOAA US weather rapports have been changed without notice. They can now be found here: http://www.erh.noaa.gov/lwx/podcasts/mp3/ An example of a script that plays out the WX-rapport for the Washington DC metro areas is: date &#62;&#62; /root/voice/wx1log /usr/bin/./mplayer -really-quiet -vc null -vo null -srate [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Ken, KE2N, has rapported that the URLs for the audio-files of the NOAA US weather rapports have been changed without notice.</p>
<p>They can now be found here: <a href="http://www.erh.noaa.gov/lwx/podcasts/mp3/">http://www.erh.noaa.gov/lwx/podcasts/mp3/</a></p>
<p>An example of a script that plays out the WX-rapport for the Washington DC metro areas is:</p>
<blockquote><p>date &gt;&gt; /root/voice/wx1log<br />
/usr/bin/./mplayer  -really-quiet -vc null -vo null -srate 8000 -af channels=1 -ao  pcm:file=/dev/stdout http://www.erh.noaa.gov/lwx/podcasts/mp3/WBCSAFNW1.mp3  | ./wavstream -t  &#8220;WX RPT&#8221; -v -i 192.168.1.111 -p 40000 W4BRM b /dev/stdin id.wav  2&gt;&amp;1 | head -1000 &gt;&gt; wx1log</p></blockquote>
<p>Thanks to Ken for the new links.</p>
<p>73</p>
<p>Kristoff ON1ARF</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.erh.noaa.gov/lwx/podcasts/mp3/WBCSAFNW1.mp3" length="221400" type="audio/mpeg" />
		</item>
		<item>
		<title>streaming D-STAR repeaters on the internet</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=20</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=20#comments</comments>
		<pubDate>Sun, 15 May 2011 11:38:55 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[d-star audio exporting tool]]></category>
		<category><![CDATA[dstar]]></category>
		<category><![CDATA[D-STAR audio-exporting toolkit]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=20</guid>
		<description><![CDATA[Hi, We have started a experimental internet-stream of module B of the D-STAR repeater in Oostende, ON0OS. This is a first test of the &#8220;D-STAR Audio Export Toolkit&#8221; (tempory name). The URL are: http://on0os.mine.nu/streams/on0os.m3u (windows/mac: use VLC, realplayer or winamp, linux: use anything you want  ) http://on0os.mine.nu/livestream (javabased webstream, works on any browser) http://new.ophidian.be:8000/on0os (direct, works inside [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>We have started a experimental internet-stream of module B of the D-STAR repeater in Oostende, ON0OS. This is a first test of the &#8220;D-STAR Audio Export Toolkit&#8221; (tempory name). The URL are:</p>
<ul>
<li><a title="ON0OS Internet stream" href="http://on0os.mine.nu/streams/on0os.m3u">http://on0os.mine.nu/streams/on0os.m3u</a> (windows/mac: use <a href="http://www.videolan.org/" target="_blank">VLC</a>, <a href="http://www.real.com/" target="_blank">realplayer</a> or <a href="http://www.winamp.com" target="_blank">winamp</a>, linux: use anything you want <img src='http://villazeebries.krbonne.net/hamstuff/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</li>
<li><a title="ON0OS livestream" href="http://on0os.mine.nu/livestream" target="_blank">http://on0os.mine.nu/livestream</a> (javabased webstream, works on any browser)</li>
<li><a title="ON0OS internet-stream" href="http://new.ophidian.be:8000/on0os" target="_blank">http://new.ophidian.be:8000/on0os</a> (direct, works inside HTML5-complient webbrowsers like firefox, opera or chrome/chromium)</li>
</ul>
<p>This stream is created inside the repeater using a DVdongle connected to the repeater. No D-STAR &#8220;radio&#8221; is involved.<span id="more-20"></span></p>
<p>The process uses a number of different tools:</p>
<ul>
<li>&#8220;cap2mc&#8221; intercepts the traffic between the repeater-gateway server (linux PC) and the repeater-controller (RPC2C) and rebroadcasts it as a local multicast-stream on the repeater. This is the only tool that needs to run as root.</li>
<li>&#8220;ambedecode&#8221; subscribes to this multicast stream, select the AMBE digital-voice stream of one particular repeater-module, sends it to the DVdongle for decoding and rebroadcasts the resulting PCM audio stream as a second multicast stream.</li>
<li>&#8220;pcm2out&#8221; subscribes to the PCM multicast stream and writes it to &#8220;standard out&#8221;, adding some comfort noise when no audio is being send.</li>
<li>This PCM-stream is send to &#8220;ices&#8221;, the standard internet-streaming broadcasting client for the &#8220;icecast&#8221; internet-streaming server.</li>
</ul>
<p>Other tools of this toolkit allow things like locally saving the AMBE or PCM-streams, or playing them out on the audio-card of the repeater (which can be linked to a local FM-transmittor using VOX control).</p>
<p>The internet-stream runs at around 32 Kbps VBR, using the vorbis audio-codec. Almost any unix or linux-based media-player (totem, xmmp, mplayer, vlc, &#8230;) is able to play this. For other platforms (windows, mac, &#8230;) use the cross-platform <a title="VLC" href="http://www.videolan.org/" target="_blank">VLC</a> media-player or natively inside the firefox or google chrome webbrowsers.</p>
<p>ON0OS/B is usually linked to either the dutch language REF028A (Belgium) or REF017A (the Netherlands) reflectors, or -at certain times- XRF017 (dutch language X-reflector), REF005A (UK) or REF001C (US) reflectors.</p>
<p>The program-code for this is still &#8220;alpha&#8221; code, but I hope to be able to make them public in about two weeks time. For questions or remarks, or are interested in co-developement of these applications, do drop me a message.</p>
<p>With thanks to Pieter ON3GPS to provide the server for the icecast streaming-server.</p>
<div>73s</div>
<div>Kristoff ON1ARF</div>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=20</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://villazeebries.krbonne.net/streams/on0os.m3u" length="93" type="audio/x-mpegurl" />
<enclosure url="http://on0os.mine.nu/streams/on0os.m3u" length="93" type="audio/x-mpegurl" />
		</item>
		<item>
		<title>voice-announcement system 0.2.1: long announcements, reflectors and more</title>
		<link>http://villazeebries.krbonne.net/hamstuff/?p=19</link>
		<comments>http://villazeebries.krbonne.net/hamstuff/?p=19#comments</comments>
		<pubDate>Mon, 28 Mar 2011 23:37:13 +0000</pubDate>
		<dc:creator>kristoff</dc:creator>
				<category><![CDATA[dstar]]></category>
		<category><![CDATA[voice-announcements]]></category>

		<guid isPermaLink="false">http://villazeebries.krbonne.net/hamstuff/?p=19</guid>
		<description><![CDATA[Hi All, I have just posted version 0.2.1 of the voice-announcement software for Icom-based D-STAR repeaters. As usual, it can be found here: http://villazeebries.krbonne.net/dstar/voice-announce/ This version has been designed with one application in mind: streaming long audio-broadcasts to repeaters. Here are the details: What is new? A new application: ambestream. This application allows a pre-encoded AMBE [...]]]></description>
			<content:encoded><![CDATA[<p>Hi All,</p>
<p>I have just posted version 0.2.1 of the voice-announcement software for Icom-based D-STAR repeaters.</p>
<p>As usual, it can be found here:<br />
<a class="moz-txt-link-freetext" href="http://villazeebries.krbonne.net/dstar/voice-announce/">http://villazeebries.krbonne.net/dstar/voice-announce/</a></p>
<p>This version has been designed with one application in mind: streaming long audio-broadcasts to repeaters. Here are the details:</p>
<p><span id="more-19"></span></p>
<p><strong>What is new?</strong></p>
<ul>
<li>A new application: ambestream. This application allows a pre-encoded AMBE file (in the .dvtool or .ambe format) to be streamed out to a repeater or a reflector.<br />
It has been specific designed for streaming long audio-messages, using a 20 ms &#8220;heartbeat&#8221; generated by the linux-kernel for stability. This is needed because some soundcard-based repeater-platforms seams to have syncronisation-problems when playing out audio-messages of over 10 minutes.</li>
<li>Both wavstream and ambestream have a number of new features:
<ul>
<li>DNS-lookup: this allows wavstream and ambestream to stream a digital voice message to both the local repeater or a remote repeater. This allows a audio-message to be streamed from any place on the internet (like a PC in your shack), so there is no need to actually have a DVdongle on the repeater to send broadcast streams on it</li>
<li>Streaming to a remote repeater can be done using the &#8220;callsign routing&#8221; protocol (UDP port 40000) and the &#8220;dextra&#8221; protocol (UDP port 30001)</li>
<li>Dextra linking: Send a voice message to a XRF reflector</li>
<li>The &#8220;mycall&#8221; setting. When streaming to remote repeaters, this allows the originator of the voice-message to identify himself/herself</li>
<li>&#8220;auto-break&#8221;: this is an option that is designed to deal with the fact that i-com repeater break of an voice-stream after -by default- 3 minutes. (see the &#8220;icom 3 minute&#8221; remarks below). Using the feature:
<ul>
<li>An ongoing transmission will automatically interrupt after a fixed interval (say 9.5 minutes)</li>
<li>The transmission will pause for a number of seconds</li>
<li>The transmission will restart, first repeating (up to) 4 seconds of the previous audio-segment</li>
<li>After that, the transmission will go on as before</li>
</ul>
</li>
<li>Ipv6 support</li>
</ul>
</li>
<li>The two applications that deal with reading PCM .wav files (wav2ambe and wavstream) are now able to read PCM-streams from standard in, allowing unix &#8220;command piping&#8221;.</li>
<li>Because of the new features, some cli-options have changed:
<ul>
<li>-i (ip-address) has become -d (destination). The -i option is still supported in this version but will dissapear in the future.</li>
<li>-d (dongle device) has become -dng</li>
<li>-h (help) now gives some (hopefully) interesting information</li>
</ul>
</li>
</ul>
<p><strong></strong></p>
<p><strong> </strong></p>
<p><strong>So what can we do with it?</strong></p>
<p>Some examples:</p>
<ul>
<li>wavstream -v -my ON1ARF -t &#8220;very interesting&#8221; ON0ABC C shortmessage.wav<br />
Stream out a PCM .wav-file &#8220;shortmessage.wav&#8221; to module C of our local (i-com based) repeater (ON0ABC). This command needs to be run locally on the repeater.</p>
<ul>
<li>the &#8220;verbose&#8221; option is set which will give more output</li>
<li>the message will be streamed with the &#8220;mycall&#8221; set to ON1ARF (which happens to be &#8230; my callsign. <img src='http://villazeebries.krbonne.net/hamstuff/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</li>
<li>the text-message &#8220;very interesting&#8221; will be added in the audio-message</li>
</ul>
</li>
<li>wavstream  &#8230; -d 192.168.100.11 &#8230;<br />
The same as above, but for a soundcard-based repeater system (which listens to IP-address 192.168.100.11)</li>
<li>wavstream -my ON1ARF -t &#8220;remote message&#8221; -d on0xyz.on.ircddb.net ON0XYZ B id.wav message.wav end.wav
<ul>
<li>Send a message to a remote repeater, found on IP-address &#8220;on0xyz.on.ircddb.net</li>
<li>The message will consist of three different wav-files: id.wav, message.wav and end.wav, played out in sequence</li>
</ul>
</li>
<li>wavstream -my ON1ARF -d xrf017.reflector.ircddb.net -p 30001 XRF017 B message.wav</li>
<li>wavstream -dxl -my ON1ARF -d xrf017.reflector.ircddb.net XRF017 B message.wav<br />
Two variations of the same application: send a audio-message to the dextra reflector XRF017, module B</p>
<ul>
<li>In the first example, NO dextra linking will be set up between the host where the streaming in initiated and the X-reflector. This can be the case where there already is a dextra link active between these two hosts; like when streaming from a repeater that is already linked to that particular reflector.<br />
Also note that the destination port has been set to port UDP 30001, which is the port used by the dextra protocol</li>
<li> In the latter example, a dextra linking setting is set up. This is needed when streaming from a host that is not already linked (like your PC in your shack) to a dextra reflector. In this case, the &#8220;-p 30001&#8243; option is not necessairy as it implicitely set by the &#8220;-dxl&#8221; option</li>
</ul>
</li>
<li>wavstream -bi 28500 -bl 250 -br 200 ON0ABC C longmessage.wav
<ul>
<li>This will play out the audio-message &#8220;longmessage.wav&#8221;.</li>
<li>After 9 minute and 30 seconds, the transmission will be interrupted (9 min and 30 second = 570 second. 570 second * 50 frames / second = 28500)</li>
<li>The transmission will stop for 5 seconds (5 sec * 50 frames/sec = 250 frames)</li>
<li>After that, the last 4 seconds of the previous audio-segment will be repeated (4 sec * 50 frames/sec = 200 frames)</li>
<li>Finally, the transmission will continue</li>
</ul>
</li>
<li>date &#8216;+ the time is, %l, %M, %p &#8216; | text2wave -F 8000 -o /dev/stdout | ./wavstream -t &#8220;speaking clock&#8221;  ON0ABC C -<br />
This is an example of a typical unix technique of stringing unix-commands one of the after and &#8220;pipe&#8221; the results of one command to the next on in line.</p>
<ul>
<li>date &#8216;+ the time is, %I, %M, %p&#8217; will give this result: (say) &#8220;the time is, 8, 30, pm&#8221;</li>
<li>this result is then fed to &#8220;text2wave&#8221; which will turn this into a spoken audio-message (inside a pcm-stream, sampled at 8000 bits per second)</li>
<li>Finaly, this audio-message is send to &#8220;wavstream&#8221;, which will send it out to the local D-STAR repeater (in this case, module C on repeater ON0ABC)</li>
</ul>
</li>
<li>mplayer -really-quiet -vc null  -vo null -srate 8000 -af channels=1 -ao pcm:file=/dev/stdout  http://www.erh.noaa.gov/nwr/lwx/WBCSAFNW1.mp3  | wavstream -t &#8220;Weather&#8221;  ON0ABC &#8220;-&#8221; id.wav<br />
This is a very interesting one (with thanks to the person who provided this) . I&#8217;ll leave it to you to find out what it does. <img src='http://villazeebries.krbonne.net/hamstuff/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p><strong>Concerning Dextra linking</strong></p>
<p>As you might have noticed, the option to enable dextra linking is &#8220;-dxl&#8221;, not &#8220;dx&#8221;. The reason is to stress what this option does: it sets up a parallel thread in the program that <strong>sets up a dextra link</strong> between the application that initiates the streaming and the remote gateway or reflector.<br />
It is important to stress this word LINK, as one has to be aware of this for a very simple reason: you can <strong>not</strong> have <strong>more then one</strong> dextra link active between two hosts.<br />
What does this mean?</p>
<div>
<ul>
<li>Say you are sending a stream from a PC HOST somewhere (i.e. your PC in your shack) to a remote dextra repeater or reflector. In that case, you will most lickely NOT have a dextra link between your box and the remote host.
<ul>
<li>In that case, you MUST set the -dxl option, as -otherwize- the remote host will ignore the stream you send it (over the dextra protocol, i.e. UDP port 30001)</li>
</ul>
</li>
<li>However, say you initiate a stream from a REPEATER to a remote repeater or reflector; there is the change that your repeater is already linked to that remote end, i.e. by the &#8220;dextra_ng&#8221; client on the repeater. So special care should be taken.
<ul>
<li>If the repeater IS NOT LINKED to the remote repeater/reflector, you MUST set the -dxl option, as -otherwize- the remote host will ignore the stream you send it.</li>
<li>If the repeater IS LINKED to the remote repeater/reflector, you MAY NOT set the -dxl option. If you would do so anyway, the new dextra link from the wavstream/ambestream application will cause the existing link between dextra_ng to get disconnected.</li>
</ul>
</li>
<li>Note that the link active between the local repeater and the remote repeater/reflector does not need to match the module you are streaming to. Concider there is a link between -say- module A on the local repeater and module A on the remote repeater/gateway, this will allow wavstream/ambestream to send a stream to ANY module on that remote gateway without the &#8220;-dxl&#8221; option</li>
</ul>
</div>
<div>
<p>Finally, note that the dextra link set up by the wavstream/ambestream application is a &#8220;dongleuser&#8221; link, not a &#8220;repeater-to-repeater&#8221; link. On the dashboard of the remote repeater or reflector, the session will be displayed as a dongle-user.</p>
<p><strong>I-com repeaters and the 3 minute rule<br />
</strong></p>
<p>Icom based repeater will -by default- disconnect a ongoing voice-stream after 3 minutes. This is an action done in the repeater-controller (RPC-2c) of the i-com repeater hardware platform. This is of course, pretty annoying if you want to send (e.g.) a 20 minutes &#8220;this week in D-STAR&#8221; audio-broadcast to that repeater.<br />
There are a number of things that can be done about this:</p>
<ul>
<li>IDRP2C.exe, the i-com application used to configure the RP2C has a hidden option: &#8220;<span>C:\Programs\Icom\ID-RP2C\IDRP2C.exe /reserve</span>&#8220;. When this option is use, additional configuration options are shown. One of them is the &#8220;TimeOut&#8221; value, which can be set up to 10 minutes.</li>
</ul>
</div>
<ul>
<li>There have also been rapport of hams that have reversed engineered the protocol used between the IDRP2C.exe application and the RP2C repeater-controller. It has been rapported that, by using &#8220;nc -u&#8221; on the repeater gateway-server, it is possible send direct specially crafted UDP packets to the RP2C, which will change this time-out value for values of over 30 minutes.</li>
<li>The &#8220;auto-break&#8221; feature of wavstream and ambestream can also be used to automatically break up the audio-messages in segments of (say) 9.5 minutes.</li>
<li>Of course, it is also possible to break up the audio-broadcast manually in segments of less then 10 minutes.</li>
</ul>
<p><strong>THANK YOU</strong></p>
<p><strong><br />
</strong>This application is the result of help I have received by a number of people: beta-testers and people who provided certain pieces of information needed for this.<br />
For reasons of privacy, I will not publish the name and/or callsign for everybody but &#8230; I think that the people who have helped me are aware of that, so .. my &#8220;thank you&#8221; to you!<br />
<strong>Have fun!!!</strong></p>
<p><strong><br />
</strong>73</p>
<p>kristoff ON1ARF</p>
<p>monday 28/03/2011</p>
]]></content:encoded>
			<wfw:commentRss>http://villazeebries.krbonne.net/hamstuff/?feed=rss2&#038;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.erh.noaa.gov/nwr/lwx/WBCSAFNW1.mp3" length="235872" type="audio/mpeg" />
		</item>
	</channel>
</rss>

