<?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>Rowetel</title>
	<atom:link href="http://www.rowetel.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.rowetel.com/blog</link>
	<description>open telephony software and hardware</description>
	<lastBuildDate>Mon, 18 Mar 2013 22:29:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>FreeDV Robustness Part 3</title>
		<link>http://www.rowetel.com/blog/?p=2965</link>
		<comments>http://www.rowetel.com/blog/?p=2965#comments</comments>
		<pubDate>Mon, 18 Mar 2013 08:56:37 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2965</guid>
		<description><![CDATA[<p>Since the last post I have explored some improvements to PAPR, and tested the 1600/2000 modes introduced in the last post in real time.  These tests have given me a little more insight into the problems with HF channels and led me to better understand the requirements. This has lead to a new 1600 bit/s <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2965">FreeDV Robustness Part 3</a></span>]]></description>
			<content:encoded><![CDATA[<p>Since the last post I have explored some improvements to PAPR, and tested the 1600/2000 modes introduced in the last post in real time.  These tests have given me a little more insight into the problems with HF channels and led me to better understand the requirements. This has lead to a new 1600 bit/s FreeDV mode specifically designed to handle these requirements.</p>
<p><strong>Peak/Average Power Ratio (PAPR) Improvements</strong></p>
<p>The FreeDV <a href="?page_id=2458">FDMDV</a> modem waveforms have a PAPR of around 12dB.  That means the peaks of the waveform are 12dB higher than the average.  So the average power of the signal is limited to 12dB less than the peak power of the amplifier.</p>
<p>Now the average transmit power sets the Bit Error Rate (BER) of the received signal.  So if we can reduce PAPR, we can raise the average power without clipping the amplifier, and improve our BER.  Peter Martinez, G3PLX, suggested that some hard clipping of the modem waveform might reduce PAPR without adversely affecting performance.  Here are the results from clipping, obtained using the fdmdv_ut simulation in an AWGN channel:</p>
<table>
<tr>
<th>Test</th>
<th>Eb/No</th>
<th>SNR</th>
<th>PAPR</th>
<th>Clip</th>
<th>BER</th>
</tr>
<tr>
<td>(a)</td>
<td>6.3</td>
<td>3.0</td>
<td>12.6</td>
<td>1.0</td>
<td>0.0134</td>
</tr>
<tr>
<td>(b)</td>
<td>6.3</td>
<td>3.0</td>
<td>7.74</td>
<td>0.7</td>
<td>0.0175</td>
</tr>
<tr>
<td>(c)</td>
<td>9.3</td>
<td>6.0</td>
<td>7.71</td>
<td>0.7</td>
<td>0.0024</td>
</tr>
<tr>
<td>(d)</td>
<td>11.3</td>
<td>8.0</td>
<td>7.74</td>
<td>0.7</td>
<td>0.0</td>
</tr>
</table>
<p>Test (a) is the baseline unclipped modem waveform with a BER of 0.0134.  If we clip the waveform to 0.7 of the peaks (b) in the same channel we get only a slight increase in BER however the PAPR has reduced by 5dB.  This is very significant, as it potentially allows us to increase the transmit power, for example by 3dB (c) or even up to 5dB (d), with significant reductions in the BER.</p>
<p>This got me thinking about what happens in a SSB radio power amplifier if we drive it into compression, a somewhat softer form of reducing the peak level than hard clipping.  So we tested various power levels on an IC7000 owned by Mark, VK5QI.  A nearby receiver and FreeDV was used to monitor the SNR of the received signal.  In this case the SNR (as measured by FreeDV) represents distortion due to compression, the tx and rx were so close that there was no significant channel noise affecting SNR.</p>
<table>
<tr>
<th>Test</th>
<th>Av Tx Power</th>
<th>SNR</th>
<th>BER</th>
</tr>
<tr>
<td>(a)</td>
<td>8</td>
<td>18</td>
<td>0</td>
</tr>
<tr>
<td>(b)</td>
<td>25</td>
<td>10.5</td>
<td>0</td>
</tr>
</table>
<p>We found that at 25W average power the radio became quite hot.  A higher average power would not be practical.  Now FreeDV users typically drive their tx at the 10-20W average level, this is a backoff from the peak 100W power of 10-7dB.  This is similar to the 7dB PAPR obtained from the hard clipping experiments above.  This is well into compression, but as we can see above the SNR is still quite high, so the distortion due to this much compression won&#8217;t affect the BER much.</p>
<p>So despite the PAPR reduction we found by experimenting with hard clipping above, it is not possible to get any further power benefits from PAPR reduction &#8211; we are already running the typical SSB power amplifier near it&#8217;s safe limits.</p>
<p><strong>Codecs for HF DV</strong></p>
<p>I spent some time watching the 1600 and 2000 bit/s modes introduced in the last post in action.  I noticed they were still falling over on typical HF fading channels, especially in the 0-5dB SNR range.  After some thought, I came up with some design ideas for HF DV modes:</p>
<ol>
<li>Intelligible speech at around 10% raw BER for QPSK (averaging all carriers over over a few seconds).</li>
<li>For a FEC code to work with a raw bit rate of 10% BER we require a low code rate (e.g. 0.3), which means lots of parity bits (a high bit rate), and large block sizes.</li>
<li>But we are constrained by latency to short blocks, and the code rate is constrained by bit rate (e.g. its hard to get more than 2000 bit/s thru this channel).</li>
<li>So it is difficult to protect all bits in the Codec with FEC.</li>
</ol>
<p>My previous tests show the excitation bits (pitch, voicing, energy) are the most sensitive.  The excitation bits affect the entire spectrum, unlike LSPs where a bit error introduces distortion to a localised part of the spectrum.</p>
<p>So I dreamt up a new 1300 bit/s Codec 2 mode that has &#8220;less&#8221; sensitive bits.  The 1300 bit/s Codec 2 mode only sends (scalar) pitch and energy once every 40ms, rather than twice for the previous 1600 Codec 2 bit/s mode.  This reduces the 0 BER quality a little, but now there is &#8220;less to go wrong&#8221; (just 16 bits for the excitation) at high BER.  Less excitation bits means they can be protected with just a few extra FEC bits.  So I added a single Golay FEC word to protect 12 of the 16 excitation bits to get a total bit rate of 1600 bit/s over the channel.  This is known as the new 1600 bit/s mode.</p>
<p>This table shows the difference between the 1300 and previous 1600 bit/s Codec 2 modes, you might be able to hear a small difference:</p>
<table>
<tr>
<th>Sample</th>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/hts1a_1300.wav">hts1a 1300 bit/s</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/hts1a_1600.wav">hts1a 1600 bit/s</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/ve9qrp_1300.wav">ve9qrp 1300 bit/s</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/ve9qrp_1600.wav">ve9qrp 1600 bit/s</a></td>
</tr>
</table>
<p>This table has some samples of the 1300 bit/s Codec 2 + 300 bit/s FEC (1600 bit/s FreeDV mode) over several simulated and real world channels, as shown in the table below:</p>
<table>
<tr>
<th>Sample</th>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/mod_test_1400_poor_4dB.wav">FreeDV V0.91 1400 bit/s CCIR poor channel 4dB</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/mod_test_1600_poor_4dB.wav">1600 bit/s CCIR poor channel 4dB</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/mod_test_1600_vk2mev_001.wav">1600 bit/s VK2MEV in Newcastle to Adelaide 20m</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust3/mod_test_1600_k5wh_k0pfx_001.wav">1600 bit/s K5WH to K0PFX with interfering SSB</a></td>
</tr>
</table>
<p>The signal sampled from VK2MEV had a reasonably high SNR (above 5dB) but a high average BER due to the constant fading:</p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_vk2mev_001_waterfall.png" /></p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_vk2mev_001_errors.png" /></p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_vk2mev_001_errors2.png" /></p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_vk2mev_001_snr.png" /></p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_vk2mev_001_timing.png" /></p>
<p>Note the number of frames in the 10 to 15% error range, and the near constant fading on at least one carrier.  As the fading is so regular, the SNR is fairly steady.  The last plot is the timing offset, which is slowly drifting downwards indicating a sample clock difference between the tx and rx sound cards.</p>
<p>The K5WH to K0PFX sample is an example of a SSB signal interfering with FreeDV:</p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_k5wh_k0pfx_001_waterfall.png" /></p>
<p align=center><img src="/images/codec2/robust3/mod_test_1600_k5wh_k0pfx_001_errors2.png" /></p>
<p>You can hear the SSB and modem signals together in <a href="/downloads/codec2/robust3/mod_test_1600_k5wh_k0pfx_001_fdmdv.wav">this sample</a> of the off air signal.  You can hear the FreeDV modem tones start up about 10 seconds in. The decoded speech (in the table above) holds up pretty well.</p>
<p><strong>Command Line</strong><br />
<code><br />
octave:1&gt; fdmdv_demod(&quot;/home/david/n4dvr.wav&quot;,1600*30,16,&quot;mod_test_1600_n4dvr_001.err&quot;)<br />
45952 bits&nbsp;&nbsp;1321 errors&nbsp;&nbsp;BER: 0.0287 PAPR(rx): 22.53 dB<br />
david@bear:~/codec2-dev/src$ ./c2enc 1300 ../raw/ve9qrp.raw - | ./fec_enc - - 1600 | ./insert_errors - - ../octave/mod_test_1600_n4dvr_001.err 64 | ./fec_dec - - 1600 | ./c2dec 1300 - - | play -t raw -r 8000 -s -2 -<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2965</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>FreeDV Robustness Part 2</title>
		<link>http://www.rowetel.com/blog/?p=2905</link>
		<comments>http://www.rowetel.com/blog/?p=2905#comments</comments>
		<pubDate>Tue, 05 Mar 2013 20:05:24 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2905</guid>
		<description><![CDATA[<p>Since the last post I have been working on two new FreeDV modes (1600 and 2000 bit/s), designed to improve the performance of FreeDV over HF multipath fading channels.  This involved modifying the Octave and C modem code to support a variable number of carriers, a new 1600 bit/s Codec 2 mode, and some C <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2905">FreeDV Robustness Part 2</a></span>]]></description>
			<content:encoded><![CDATA[<p>Since the <a href="?p=2879">last post</a> I have been working on two new FreeDV modes (1600 and 2000 bit/s), designed to improve the performance of FreeDV over HF multipath fading channels.  This involved modifying the Octave and C modem code to support a variable number of carriers, a new 1600 bit/s Codec 2 mode, and some C code to implement FEC.  Once again I&#8217;ve included the command lines I am using for those who want to repeat the simulations.  It&#8217;s also useful for me to write the commands down so I can find them again!</p>
<p>The 1600 bit/s mode uses simplified scalar pitch and energy quantisers.  This makes it more robust to bit errors, but at a cost of increased bit rate.  The increase equates to a 10log10(1600/1400) = 0.5dB drop in SNR, which is pretty modest. The 2000 bit/s mode uses the 1400 bit/s codec, plus 600 bit/s of FEC to protect the first (and most sensitive) 24 bits of the Codec data.</p>
<p>Here are the results over a simulated &#8220;CCIR moderate&#8221; channel with 10dB SNR:</p>
<table>
<tr>
<th>Sample</th>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_1400_moderate_10dB.wav">Baseline 1400 bit/s with no FEC</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_1600_moderate_10dB.wav">1600 bit/s Codec 2 with no FEC</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_2000_moderate_10dB.wav">2000 bit/s, 1400 bit/s Codec + 600 bit/s FEC</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/ssb_moderate_10dB.wav">Analog SSB</a></td>
</tr>
</table>
<p>Out of the digital modes, I think 2000 bit/s is best, with 1600 bit/s quite close.  Compared to the analog, the digital has some annoying R2D2 sounds, but lacks the constant hiss. At 2000 and 1600 bit/s my goal of intelligible speech over a HF multipath channel is, I think, achieved. Here is a typical waterfall, bit error pattern, and SNR against time for this channel:</p>
<p align=center><img src="/images/codec2/robust2/mod_test_2000_moderate_10dB_waterfall.png" /></p>
<p align=center><img src="/images/codec2/robust2/mod_test_2000_moderate_10dB_errors.png" /></p>
<p align=center><img src="/images/codec2/robust2/mod_test_2000_moderate_10dB_snr.png" /></p>
<p>Note the sample files only play the decoded audio for the first 12 seconds, the plots cover 30 seconds.</p>
<p>Here are some results on a &#8220;CCIR poor&#8221; channel at 4dB SNR, followed by the waterfall, bit error pattern, and SNR plot against time.  The poor channel has faster fading and with the low SNR we have a much higher BER (which averages 8% before FEC). </p>
<table>
<tr>
<th>Sample</th>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_1400_poor_4dB.wav">Baseline 1400 bit/s with no FEC</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_1600_poor_4dB.wav">1600 bit/s Codec 2 with no FEC</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_2000_poor_4dB.wav">2000 bit/s, 1400 bit/s Codec + 600 bit/s FEC</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/ssb_poor_4dB.wav">Analog SSB</a></td>
</tr>
</table>
<p align=center><img src="/images/codec2/robust2/mod_test_1600_poor_4dB_waterfall.png" /></p>
<p align=center><img src="/images/codec2/robust2/mod_test_1600_poor_4dB_errors.png" /></p>
<p align=center><img src="/images/codec2/robust2/mod_test_1600_poor_4dB_snr.png" /></p>
<p>Although they are all pretty bad, in this case I think the 1600 bit/s version performs best.  A QSO might &#8220;just&#8221; be possible. Actually it&#8217;s quite remarkable that we can hear anything given an average BER of 8%!  I think the poorer performance of 2000 bit/s on this channel is an example of FEC breaking down at low SNRs/high BERs.  The FEC is actually making more bit errors than it corrects!  Digital voice is unique in the low SNRs/high BERs it operates in compared to regular data.</p>
<p>The fluttering at the start of the 1600 bit/s sample might be caused by bit errors in the frame energy parameter causing the level to jump around, or possibly bit errors in the voicing bit.  If we know the channel is bad (the modem can tell us), we could &#8220;lock down&#8221; a few bits to enhance speech on poor channels.  For example force all frames to be voiced, or smooth rapid changes in the energy.  This could even be a &#8220;DV noise reduction&#8221; checkbox the operator can enable on poor channels.  Try doing that with your closed source Codec!</p>
<p>The SSB sample is still very intelligible, perhaps better than the digital if you don&#8217;t mind the hiss.  We still have a long way to go (maybe 6dB?) to do better than SSB in poor channel conditions!</p>
<p><strong>Command Lines</strong></p>
<p>The samples above were generated by some magical command line incarnations that run simulations of various parts of the system.  Pathsim is used to generate modem files corrupted by the simulated HF channel.  I then use a GNU Octave simulation of the demod to generate the bit error patterns for that mode/channel combination.  For example the 1400 bit/s mode:<br />
<code><br />
octave:18&gt; fdmdv_demod(&quot;../src/mod_test_1400_poor_4dB.wav&quot;,1400*30,14, &quot;mod_test_1400_poor_4dB.err&quot;)<br />
38640 bits&nbsp;&nbsp;2773 errors&nbsp;&nbsp;BER: 0.0718 PAPR(rx): 16.20 dB<br />
</code><br />
This means take the mod_test_1400_poor_4dB.wav file as input, demodulate 30 seconds worth of bits at 1400 bit/s, using a 14 carrier modem, and save the error patterns to mod_test_1400_poor_4dB.err.  Running the simulation also generates a bunch of nice plots to help me work out what&#8217;s going on, some of which are above.</p>
<p>Next step is to insert the bit errors into a Codec 2 bit stream and decode the results.  I do this with a bunch of piped command line tools:<br />
<code><br />
~/codec2-dev/src$ ./insert_errors ve9qrp_1400.c2 - ../octave/mod_test_1400_poor_4dB.err 56 | ./c2dec 1400 - - | play -t raw -r 8000 -s -2 -<br />
</code></p>
<p>The &#8220;56&#8243; above refers to the number of bits/frame for the 1400 bits/s mode. When testing the 2000 bit/s mode I  use additional command line tools for the FEC, for example:<br />
<code><br />
~/codec2-dev/src$ ./fec_enc ve9qrp_1400.c2 - | ./insert_errors - - ../octave/mod_test_2000_poor_4dB.err 80 | ./fec_dec - - | ./c2dec 1400 - - | play -t raw -r 8000 -s -2 -<br />
</code></p>
<p>And finally to generate a 12 second output wave file (this time for the 1600 bit/s mode):<br />
<code><br />
~/codec2-dev/src$ ./insert_errors ve9qrp_1600.c2 - ../octave/mod_test_1600_poor_4dB.err 64 | ./c2dec 1600 - - | sox -t raw -r 8000 -s -2 - mod_test_1600_poor_4dB.wav trim 0 12<br />
</code></p>
<p>Simulating communications systems on the command line.  Who needs a GUI?</p>
<p><strong>Off Air Examples</strong></p>
<p>Simulated channels are useful as the channel is the same for each run, so a direct comparison of the 3 modes on exactly the same channel can be made.  However I wanted to backup these simulated results with some bit errors from real world, off air HF channels.</p>
<p>So last Saturday I hooked up with Mark, <a href="http://rfhead.net">VK5QI</a>, on 40m.  It was a pleasant Summer (well early Autumn) evening for us.  Mark and Andy VK5AKH set up a 40m dipole up the back of the Morialta Conservation Park in Adelaide, and were using a Codan 2110 Manpack for most of the testing. </p>
<p>I was operating &#8220;portable&#8221; in a backyard in Geelong, with an end fed dipole strung from an 8m squid pole.  I was happy to find that my FT-817 with 2.5W SSB could reach 800km to Mark so we could coordinate the tests.  At my end the analog SSB was noisy (beneath my urban S8 background noise level) but intelligible.  Just the sort of channel I&#8217;d like FreeDV to work over.</p>
<p>Some pictures of Mark&#8217;s portable station are <a href="http://imgur.com/a/wXOHu">here</a>.</p>
<p>I generated some modem files with test data sent using 14, 16 &#038; 20 tones.  Mark played these files to me over his tx at about 4W average power and I received and recorded them using the FreeDV &#8220;record from radio&#8221; feature on the Tools menu.  We recorded several samples of each mode &#8211; and each sample was quite different due to the ever changing nature of HF radio channels.  Later, I ran the recorded files through the simulations described above to produce samples of the bit error patterns and decoded voice over the three modes.  Here are four examples of the 2000 bit/s mode, taken a few minutes apart, followed by the usual plots for one of them (serial 003).  These are longer samples, about 30 seconds, to make sure we experience a few fades.</p>
<table>
<tr>
<th>Sample</th>
<th>Average BER</th>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_2000_vk5qi_001.wav">2000 bit/s 001</a></td>
<td>0.010</td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_2000_vk5qi_002.wav">2000 bit/s 002</a></td>
<td>0.013</td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_2000_vk5qi_003.wav">2000 bit/s 003</a></td>
<td>0.020</td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust2/mod_test_2000_vk5qi_004.wav">2000 bit/s 004 11W</a></td>
<td>0.062</td>
</tr>
</table>
<p align=center><img src="/images/codec2/robust2/mod_test_2000_vk5qi_003_waterfall.png" /></p>
<p align=center><img src="/images/codec2/robust2/mod_test_2000_vk5qi_003_errors.png" /></p>
<p align=center><img src="/images/codec2/robust2/mod_test_2000_vk5qi_003_snr.png" /></p>
<p>If you listen to sample 3, you can hear errors creep in at times corresponding to the low SNR (high BER) points in the plots above.</p>
<p>Sample 004 is an example of too much Tx drive. To illustrate this, Mark intentionally cranked the average power up from 4W to 11W, on a radio that is rated 25W PEP for SSB.  This distorts the modem waveform, the BER goes up, and it sounds bad.</p>
<p>Unlike the simulations, the waterfall for off air samples shows the effect of the SSB rx AGC bringing the noise level up during fades, as it seeks to maintain the same average output level.  The noise at the start and end of the waterfall is the channel noise before and after the 30 second test wave file.</p>
<p>This was a noisy but intelligible SSB channel for me, and FreeDV sounds OK over it.  That&#8217;s pretty much what I am aiming at &#8211; for FreeDV to work about as well as SSB over HF multipath channels.</p>
<p><strong>Next Steps</strong></p>
<p>So now it&#8217;s time to try some real QSOs with these new modes and see if we have made any real progress.  There is danger in getting too far ahead of oneself with simulations.  A common mistake is getting a good result, declaring &#8220;victory&#8221;, then moving on when some bug is actually means you are fooling yourself.  To support the new modes in FreeDV means quite a bit of coding which will keep me busy for the next week or so!  </p>
<p>Once I am ready for testing the first step will be to establish the flatness of the tx response using this <a href="/downloads/codec2/1k_2k_sweep.wav">swept sine wave</a>.  Then ensure SSB works OK over a given channel, and start trying the new modes, in particular looking for examples of fading that break the modes.</p>
<p>Further down the track it would be nice to try different FEC and modulation schemes, lower Codec bit rates with strong FEC, attenuating or masking the annoying R2D2 sounds when there are bit errors, and (Peak/Average Power Ratio) PAPR improvements to increase our average transmitted power.</p>
<p><strong>How You Can Help</strong></p>
<p>I am interested in finding some more examples of channels that break the new modes.  If you and a friend are set up for digital modes, then you can play and record wave files over a HF channel.  By making off-air recordings of my modem test files, you can help me gather examples of real world HF channels, and help improve FreeDV.</p>
<p>Here is how you can help:</p>
<ol>
<li>If you are using FreeDV and find it&#8217;s not decoding, switch to SSB and confirm you can still communicate OK.</li>
<li>Download and play these files (<a href="/downloads/codec2/mod_test_1400.wav">mod_test_1400.wav</a>, <a href="/downloads/codec2/mod_test_1600.wav">mod_test_1600.wav</a>, <a href="/downloads/codec2/mod_test_2000.wav">mod_test_2000.wav</a>) over the channel, while your partner records the received audio.  Make a separate recording for each file. The files are 30 seconds long, so I set the record time for 40 seconds.  The FreeDV Tools-Record From Radio feature is a convenient way to record. It doesn&#8217;t matter if there is some noise at either end of the recording.
<li>Name the recorded files mod_test_1400_yourcallsign.wav, mod_test_1600_yourcallsign.wav, mod_test_2000_yourcallsign.wav.</li>
<li>Email them to me.</li>
</ol>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2905</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>FreeDV Robustness Part 1</title>
		<link>http://www.rowetel.com/blog/?p=2879</link>
		<comments>http://www.rowetel.com/blog/?p=2879#comments</comments>
		<pubDate>Sun, 24 Feb 2013 22:48:41 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2879</guid>
		<description><![CDATA[<p>Here is the next installment in my adventure of making FreeDV work as least as well as analog SSB over HF multipath fading channels.  I&#8217;ve included the command lines I am using for those who want to play along with me.</p>
<p>Incremental Improvements</p>
<p>Over the past few weeks I have made some incremental improvements:</p>

Bill Cowley pointed out <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2879">FreeDV Robustness Part 1</a></span>]]></description>
			<content:encoded><![CDATA[<p>Here is the next installment in my adventure of making FreeDV work as least as well as analog SSB over HF multipath fading channels.  I&#8217;ve included the command lines I am using for those who want to play along with me.</p>
<p><strong>Incremental Improvements</strong></p>
<p>Over the past few weeks I have made some incremental improvements:</p>
<ol>
<li><a href="?p=2851#comment-65484">Bill Cowley</a> pointed out the Gray code mapping was wrong.  That&#8217;s worth up to 25% of the Bit Error Rate (BER).</li>
<li>Some SSB transmitters may have a non-flat frequency response.  This can have a big effect on FreeDV performance. I encourage anyone using FreeDV to test your transmitters frequency response using <a href="  http://rowetel.com/downloads/codec2/1k_2k_sweep.wav">this wave file</a> and power meter. This file sweeps between 1000 Hz and 2000 Hz over 10 seconds.  Just play it through the same rig interface at the same levels as you would run FreeDV.  The power of the tone is about the same as the FreeDV modem signal. Monitor the variation in power over the sweep, for example if the power changes between 10W and 20W that&#8217;s a 3dB slope.</li>
<li>Improvements to the sync state machine algorithm to avoid sync dropping out so when a fade temporarily wipes out the centre BPSK sync carrier.</li>
</ol>
<p><strong>Testing FreeDV over HF Channels</strong></p>
<p>I need a repeatable way to test the system.  The first step was to generate a 30 second file (1400 bit/s x 30 = 42000 bits) of modulated test bits (112 bit sequence that repeat every 80ms) using the command line tools:<br />
<code><br />
~/codec2-dev/src$ ./fdmdv_get_test_bits - 42000 | ./fdmdv_mod - mod_test_v1.1.raw<br />
</code></p>
<p>This file was converted to a wave file using sox and sent to some friends for transmission over the air.  This gives me samples of bit errors over real HF channels. I have been passing it through the <a href="http://www.moetronix.com/ae4jy/pathsim.htm">Pathsim</a> HF channel simulator (which runs well on Linux under Wine):</p>
<p align=center><img src="/images/codec2/robust1/pathsim.png" /></p>
<p>After processing by Pathsim, I can use the Octave demod simulation to demodulate the signal and generate error patterns:<br />
<code><br />
octave:12&gt; fdmdv_demod(&quot;../src/mod_test_v1.1_moderate_10dB.wav&quot;,1400*30,&quot;moderate_10dB_inter.err&quot;)<br />
</code></p>
<p>Here is the waterfall and bit error patterns for the CCIR 10dB Moderate channel:</p>
<p align=center><img src="/images/codec2/robust1/moderate_10dB_waterfall.png" /></p>
<p align=center><img src="/images/codec2/robust1/moderate_10dB_errors.png" /></p>
<p>Using my handy collection of command line tools I can then apply this bit error pattern to a Codec 2 bit stream and listen to the results:<br />
<code><br />
/codec2-dev/src$ ./insert_errors ve9qrp.c2 - ../octave/moderate_10dB.err 0 55 | ./c2dec 1400 - - | play -t raw -r 8000 -s -2 -<br />
</code></p>
<p>Note ve9qrp.c2 is a 1400 bit/s Codec 2 file, the &#8220;0 55&#8243; parameters specifies the range to apply bit errors to.  This range lets me simulate the effect of errors on different parts of the Codec 2 frame.  Not all bits are created equal. I happen to know that the excitation bits (voicing, pitch/energy VQ) are the most sensitive.  They live in the first 20 bits of the 56 bit frame.  </p>
<p>I am interested in using a (24,12) Golay code which can protect multiples of 12 bits.  If we protect two blocks of 12 bits thats the first 24 bits protected. Lets assume this code can correct all bit errors.  To simulate the effect of perfect FEC on the first 24 bits (with no protection on the last 32 bits) we can use:<br />
<code><br />
/codec2-dev/src$ ./insert_errors ve9qrp.c2 - ../octave/moderate_10dB.err 24 55 | ./c2dec 1400 - - | play -t raw -r 8000 -s -2 -<br />
</code></p>
<p>This seems to work pretty well, as you can see from the samples below:</p>
<table>
<tr>
<th>Sample</th>
</tr>
<tr>
<td><a href="/downloads/codec2/robust1/mod_test_v1.1.wav">Modem signal</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust1/mod_test_v1.1_moderate_10dB.wav">Modem signal (CCIR moderate 10dB)</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust1/ve9qrp_moderate_10dB_0_55.wav">Codec 2 with errors on all bits 0 to 55</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust1/ve9qrp_moderate_10dB_24_55.wav">Codec 2 with errors on bits 24 to 55 (simulated FEC)</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust1/ve9qrp_1400.wav">Codec 2 with no errors</a></td>
</tr>
<tr>
<td><a href="/downloads/codec2/robust1/ve9qrp_ssb_moderate_10dB.wav">Analog SSB (CCIR moderate 10dB)</a></td>
</tr>
</table>
<p>This suggests some FEC protecting the first 24 bits will give good performance on HF multipath channels, with intelligibility similar to analog SSB &#8211; but without the noise.</p>
<p><strong>Increasing the bit rate</strong></p>
<p>We currently use all of the 1400 bit/s for the Codec 2 data. We now need some more bits to carry FEC information.</p>
<p>One strategy is to make Codec 2 operate at a lower bit rate (say 1000 bit/s), then use the balance (say 400 bits/s) for FEC.  This is tricky, as Codec 2 already operates at a pretty low bit rate. It might be possible if we make wider use prediction of the Codec parameters (i.e. sending differences), and/or vector quantisation (big tables to quantise a bunch of parameters at once).  Prediction means the effect of an uncorrected bit error propagates into future frames.  Vector Quantisation means a single bit error can change many parameters all at once.  </p>
<p>So lowering the Codec 2 bit rate is likely to make the Codec <strong>more</strong> sensitive to bit errors.  This might still be OK if we use blanket FEC protection of all bits. Some people prefer this approach, but I am not going to work on it for now. Instead I will stick with the 1400 bit/s speech codec and look at increasing the bit rate over the channel to provide bits for FEC.</p>
<p>Lets say we need to protect 24 bits/frame with a half rate code.  That means we need a total of 56+24 = 80 bits/frame or 2000 bits/s. Some options are:</p>
<ul>
<li>Go from 14 to 20 QPSK carriers, this will make the bandwidth 20x75Hz/carrier = 1500Hz, and reduce the power per carrier by 14/20 or 1.54dB.  The wider bandwidth may cause problems with the skirts of the Tx audio filtering. Twenty carriers will also make Peak/Average Power Ratio (PAPR) problems worse, perhaps reducing our effective power output further by requiring further tx drive back off.</li>
<li>We could increase the symbol rate from 50 to 100 baud.  This would reduce the energy/symbol by 3dB, but we would need only 10 carriers to get 2000 bit/s which means a power increase per carrier of 14/10 or 1.46dB so once again we have a difference of 3-1.46 = 1.54dB.  The bandwidth of the signal would be 10*150Hz/carrier = 1500Hz. PAPR would be improved as we have only 10 carriers.</li>
<li>We could go to 10 carriers using 8PSK, this would reduce our energy/bit by about 3dB (according to <a href="http://www.ant.uni-bremen.de/whomes/rinas/dfsim/dfblocks/toolbox/Communications/ErrorRates/DPSK/DPSK_gray_AWGN_EbN0_BER.disp.html">this</a> graph), but we would gain 1.54dB by moving from 14 carriers to 10, giving a raw performance 1.46dB less than the current 1400 bit/s waveform.  The bandwidth would be a very tight 10x75Hz/carrier = 750Hz, narrower than the current 1400 bit/s, 1100Hz wide waveform.  PAPR will be better. The narrow bandwidth has pros and cons &#8211; good for channel density and interference, but bad for frequency diversity &#8211; a wider bandwidth is generally better for handling frequency selective fading.
</ul>
<p><strong>Why does Analog SSB work so well?</strong></p>
<p>I have been thinking about the differences between analog SSB and digital speech.  I figure we might be able to learn from the strengths of Analog SSB:</p>
<ul>
<li>Frequency selective fading causes frequency selective filtering of the analog signal which is no big deal as speech is very redundant.  With digital speech a freq selective fade may wipe out a bit that carries information for the entire spectrum, for example the voicing, pitch or energy bits.</li>
<li>There is no memory in analog speech. An &#8220;error&#8221; in the speech spectrum only affects the signal at the time it occurs.  A bit error in digital speech may affect future bits for a few 100ms, if predictive coding of model parameters is used (e.g. the pitch/energy quantiser in Codec 2).</li>
<li>As the SNR drops the analog signal drops into the noise. The human ear is good at digging signals out of noise, although it can be fatiguing.  Digital errors due to low SNR cause R2D2 sounds that the human ear finds harder to make sense of.</li>
<li>Analog speech automatically applies more power to the perceptually important low speech frequencies, as the audio signal entering the microphone from your mouth has higher low frequency energy.  So as the SNR drops the perceptually important low frequency energy is the last to go, an ideal situation.</li>
<li>The FDM modem waveform is sensitive to clipping of the peaks.  The analog signal processing of the SSB receiver and ear of the listener is not.  So analog speech can be sent at a higher average power level.</li>
<li>Codec 2 produces intelligible speech up to a bit error rate of about 2%.  Now 0.02 of 56 bit/s frame is about 1 bit error.  So if even one carrier is suppressed by a fade we are in trouble with digital speech.</li>
<li>The FDMDV modem signal is narrower than analog SSB, so a fade of the same width wipes out proportionally more of the digital signal.</li>
<li> A fade during silence (say between syllables or words) or in a low energy (inter-formant) area of the speech spectrum has no effect on analog signals.  A fade in silence frames or in any part of the modem signal spectrum has an effect on the digital speech.</li>
<p>For comparison, here is the waterfall (spectrogram) for the analog SSB sample:</p>
<p align=center><img src="/images/codec2/robust1/moderate_10dB_ssb.png" /></p>
<p>The strong vertical lines are due to clipping by the channel simulator as it&#8217;s AGC adjusts, this can also be heard as clipping in the analog sample.  This is probably a set up error on my part.  The comb like lines are the pitch harmonics of the speaker.  Note the bandwidth is much wider than the FDMDV signal.  Unlike the spectrogram of the FDMDV signal, it&#8217;s not obvious where the fades are.  Most of the &#8220;area&#8221; of the spectrogram is low energy (blue) &#8211; silence in the time domain or low energy regions in the frequency domain.</p>
</ul>
<p><strong>Next Steps</strong></p>
<p>The next step is to modify the Octave modem simulation so it support 8PSK as well as QPSK, and a run-time defined number of carriers.  This can then be used to generate waveforms that can be played over the air or through the channel simulator.  I&#8217;ll then build up some command line programs to send Codec frames that include various combinations of FEC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2879</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://rowetel.com/downloads/codec2/1k_2k_sweep.wav" length="160044" type="audio/wav" />
		</item>
		<item>
		<title>Dead DC-DC converter in my EV</title>
		<link>http://www.rowetel.com/blog/?p=2862</link>
		<comments>http://www.rowetel.com/blog/?p=2862#comments</comments>
		<pubDate>Mon, 11 Feb 2013 00:46:57 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Electric Vehicles]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2862</guid>
		<description><![CDATA[<p>About a week ago I returned from LCA 2013 after being away from home for 1 month.  My EV was parked at a house close to the airport.  It burst into life and off I went. However about 1 km from home the front lights and dash went dim and the EV ground to <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2862">Dead DC-DC converter in my EV</a></span>]]></description>
			<content:encoded><![CDATA[<p>About a week ago I returned from <a href="?p=2840">LCA 2013</a> after being away from home for 1 month.  My <a href="?page_id=17">EV</a> was parked at a house close to the airport.  It burst into life and off I went. However about 1 km from home the front lights and dash went dim and the EV ground to halt.  It looked like the 12V system was dead. With some kind help from my daughter and her friends we pushed the car home and the next morning I went to work.</p>
<p>As I suspected, the 12V battery was flat.  I traced the problem to the DC-DC converter, which appeared to be dead.  In an EV, the DC-DC converter works like the alternator in an internal combustion car.  It converts the traction battery voltage (in my case about 120V) to 13.8V to power the 12V systems of the car and charge the 12V battery.  In an EV only a small 12V battery is required.  Just enough to power the 12V systems when the car is off and close the solid-state relay that switches power to the DC-DC converter when the car is &#8220;on&#8221;.  Once the DC-DC converter is on it takes over, providing power to the 12V systems and charging the 12V battery.</p>
<p>The DC-DC converter must have died a few days before I left.  The 12V battery by itself could supply the few amps required for a few days.  Leaving the car for a month meant the 12V (lead acid) battery was further discharged.  So there was just enough left in the 12V battery to run the car at night without the DC-DC converter for 10 minutes before it was completely discharged.  No 12V power meant no power to close the contactor solenoid and the EV stopped &#8211; despite a nearly full traction battery.</p>
<p>I ordered a new <a href="http://www.evworks.com.au/index.php?product=DChen">DC-DC converter</a> from EV-Works for $179 including shipping. To limp around until my new DC-DC converter arrived I manually charged the 12V battery each day.  During day time driving the 12V system only draws a few amps to run the contactor, indicators, and brake lights.  So I restricted my driving to day time to avoid the 14A load of the headlights.</p>
<p>A few days later the new DC-DC converter was installed in about 1 hour by crimping the connections to the existing wiring.  The mounting holes fit the old DC-DC converter mounting holes under the passenger front seat. The new unit outputs 14.1V under light load, which delivered 13.8V to the 12V battery terminals.  The 0.3V voltage drop is due to schottky diodes mounted on the battery terminals to prevent the battery discharging into the DC-DC converter when the car is off. </p>
<p>The DC-DC converter model I purchased was rated at 144V, with a minimum voltage of 115V.  This was a concern, as my pack regularly drops beneath 115V under load. So I went for a driving test.  With the headlights on high beam, and the car accelerating (bringing the traction pack voltage down to 110V) the DC-DC output voltage dropped to a minimum of 13.5V which is quite acceptable.  Here is my clamp on ammeter next to teh new DC-DC converter  measuring the &#8220;idle&#8221; current of the EV, I think it&#8217;s topping up the lead acid battery:</p>
<p align=center><img src="/images/ev_dcdc.jpg" /></p>
<p>This new DC-DC converter doesn&#8217;t have a fan, the old one looked more like a PC power supply and had a fan that would stop and start as I drove.  In fact it was noisiest thing inside my EV.</p>
<p>My EV is a one off prototype, so I expect occasional problems like this.  Still 1 hours work and $179 in the 12 months since <a href="?p=2419">the last bug </a>is not bad.  My little EV has now done 33,000 electric km since conversion about 4 years ago.</p>
<p><strong>Living Without a Petrol Car</strong></p>
<p>About a year ago I sold my old ICE car, and have been experimenting with living with just the EV here at my home in Adelaide.  It&#8217;s working out well.</p>
<p>The longest regular trip I make is to a friends country property, about 40km each way at 80-100 km/hr.  I usually stay at his house for a few hours, charging while I am there to top up the pack.  For an interstate road trip last year I rented an ICE car for 1 week, and some times I borrow my parents car when I need a 5 seater (my EV is limited to 4 seats).</p>
<p>I feel I am experimenting with different forms of car ownership.  Rather than owning a long range ICE car and a short range EV, I am using an EV I own for 95% driving then temporarily using cars I don&#8217;t own for the rarer longer distance trips.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2862</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HF Modem Bit Error Patterns</title>
		<link>http://www.rowetel.com/blog/?p=2851</link>
		<comments>http://www.rowetel.com/blog/?p=2851#comments</comments>
		<pubDate>Sat, 09 Feb 2013 22:30:35 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2851</guid>
		<description><![CDATA[<p>I am working on improving the performance of FreeDV on HF channels.  As a first step I have been exploring the bit error patterns from the modem using some samples of a 1300 km HF radio path.  These samples were kindly collected by Mark, VK5QI and Brenton, VK2MEV.</p>
<p>The FDMDV modem has 14 DQPSK data <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2851">HF Modem Bit Error Patterns</a></span>]]></description>
			<content:encoded><![CDATA[<p>I am working on improving the performance of <a href="http://freedv.org">FreeDV</a> on HF channels.  As a first step I have been exploring the bit error patterns from the modem using some samples of a 1300 km HF radio path.  These samples were kindly collected by Mark, VK5QI and Brenton, VK2MEV.</p>
<p>The FDMDV modem has 14 DQPSK data carriers.  As I know the data that was transmitted, I can calculate the location of each bit error against time.  Here are the bit error patterns for the 50W tx power sample, with the waterfall (spectrogram) of the same signal plotted below:</p>
<p align=center><img src="/images/codec2/biterror/ber_pattern_50W.png" /></p>
<p align=center><img src="/images/codec2/biterror/spectrogram_50W.png" /></p>
<p>The red and blue lines indicate bit errors for the two bits modulated on each carrier.  The number of each carrier (1 to 14) is on the LH axis.  The x axis for both plots is time (500 bits/carrier and 10 seconds total).</p>
<p>At around 4-6 seconds on the waterfall we can see a fade in the top few carriers, with a corresponding burst of errors in the top few carriers of the bit error plot.  Good.</p>
<p>However there are also two strange bit error effects.  Firstly, the lowest few carriers have a permanently high bit error rate. The waterfall always shows a blue colour for these carriers &#8211; indicating a low power level.  They are attenuated all of the time relative to the other carriers, as well as experiencing some fades at 2-3 and 8-9 seconds.  Normally for a HF channel the level (and hence SNR and Bit Error Rate) should go up and down as the channel evolves.  This suggests something is attenuating the carriers at around 500Hz, possibly some analog (high pass?) filtering in the SSB transmitter. It can&#8217;t be filtering in the receiver, as that would affect the level of both the signal and noise, and hence not affect the SNR or BER.  </p>
<p>FreeDV has the ability to replay recorded samples from the SSB receiver.  This gives an animated display of the spectrum and waterfall, which can show more information than a fixed image.  Here is a screen shot of FreeDV replaying the 50W sample, also showing the lower tones being constantly attenuated:</p>
<p align=center><img src="/images/codec2/biterror/freedv_50W.png" /></p>
<p>In this case the waterfall is rotated (time on the vertical axis) compared to the waterfall plot above.</p>
<p>This sample has a centre frequency of 1200Hz.  This has since been changed to 1500Hz, which I am hoping will fix the problem by moving the lower tones into a flatter region of the SSB radio passband.  It does illustrate how important station set up can be for digital modes &#8211; we really want all the carriers to have the same TX power.  We need a way to detect this sort of problem &#8211; otherwise we are introducing bit errors for no reason.  Perhaps a &#8220;test frame&#8221; mode for FreeDV, so a friend can monitor the BER of each of your carriers, while you adjust your station.</p>
<p>The second strange effect can be observed in the bit error pattern for carrier 8.  Bit errors are occurring at regular intervals, rather than the random distribution we would expect.  Between symbols 300 and 400 (2 seconds) I count 9 bit errors. Now the FDM modulator waveform has a spiky nature, for example here is 10 seconds of the modulator waveform:</p>
<p align=center><img src="/images/codec2/biterror/tx_waveform.png" /></p>
<p>This because every now and again all of the carriers have the same phase, which sum to a big amplitude spike.  The large spikes occur at a rate of 9 every 2 seconds.  This suggests we are over driving the transmitter, causing distortion of the modem waveform and hence bit errors.</p>
<p>Lets look at a sample generated using 18W of transmit power (plotted below with corresponding waterfall).  In this case there is less evidence of regularly spaced bit errors.  This supports our theory that the TX was over driven in the 50W sample.  However we can still see the effects of attenuation in the low frequency carriers (a high bit error rate).  The bursts of errors sweeping through one carrier after another are also more obvious, corresponding to diagonal stripes on the spectrogram.</p>
<p align=center><img src="/images/codec2/biterror/ber_pattern_18W.png" /></p>
<p align=center><img src="/images/codec2/biterror/spectrogram_18W.png" /></p>
<p>The next step is to gather some more off air samples using the 1500Hz centre frequency and see if the bit error pattern for the low frequency carriers improves.  I am also coding up tests for interleaving and experimenting with unequal error protection schemes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2851</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>linux.conf.au (LCA) 2013</title>
		<link>http://www.rowetel.com/blog/?p=2840</link>
		<comments>http://www.rowetel.com/blog/?p=2840#comments</comments>
		<pubDate>Thu, 07 Feb 2013 03:03:41 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2840</guid>
		<description><![CDATA[<p>Last week I attended lca.conf.au 2013, my sixth LCA.  It was a very well organised and enjoyable conference for me.  After a few days back I miss it. I have made some good friends at LCA over the years, and catching up with them is as important for me as the conference talks. It <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2840">linux.conf.au (LCA) 2013</a></span>]]></description>
			<content:encoded><![CDATA[<p>Last week I attended lca.conf.au 2013, my sixth LCA.  It was a very well organised and enjoyable conference for me.  After a few days back I miss it. I have made some good friends at LCA over the years, and catching up with them is as important for me as the conference talks. It also leads to some fascinating &#8220;hallway track&#8221; talks and lots of bright ideas for new projects.</p>
<p><strong>Codec 2 and FreeDV</strong></p>
<p>This year because of my <a href="/codec2.html">Codec 2</a> &#038; <a href="http://freedv.org">FreeDV</a> work I met many people who were involved with Amateur (Ham) Radio.  <a href="http://rfhead.net">Mark VK5QI</a>, and <a href="http://www.zindello.com.au">Josh VK3XJM</a>, set up portable antennas and worked some FreeDV from various sites around the conference.  Although I am an author of FreeDV I don&#8217;t have an operational HF station to test it on, so it&#8217;s an eye opener for me to see it in action.</p>
<p>There is a lot in common between the Open Source and Ham Radio communities, for example experimentation, communication, sharing information, open hardware and software, and the way new comers are welcomed and helped.  There are also some contrasts &#8211; the average age of Hams and Linux users are several decades apart and the majority of Hams use Windows.  </p>
<p>I can see a lot of benefit in bringing the two groups together.  Linux users are fascinated with radio, and Hams can benefit from open source.</p>
<p>I spoke on Open Source Digital Radio (<a href="/downloads/codec2/lca_2013_open_source_digital_radio.odp">Open Office slides<a/> and <a href="http://mirror.linux.org.au/linux.conf.au/2013/ogv/Open_Source_Digital_Radio.ogv">OGV video</a> and <a href="http://mirror.linux.org.au/linux.conf.au/2013/mp4/Open_Source_Digital_Radio.mp4">MP4 video</a>).  I had some good feedback on my explanation of Codec 2, which is based on this <a href="http://freetel.svn.sourceforge.net/viewvc/freetel/codec2-dev/octave/codec2_demo.m?revision=461&#038;view=markup">Octave Script</a> which I run during the presentation.  The script has buttons to allow flipping between the time domain, frequency domain, and harmonic sample views. It allows single stepping through frames to create an animated effect. Watch the video to see how it comes together.</p>
<p>As I described <a href="?p=2305">last year</a> there is an art to presenting a deeply technical topic (like speech coding) to an audience without specific domain knowledge.  I want the talk to be interesting, comprehensible, and to send each member of audience away with 3 pieces of new knowledge.  So I vary each presentation, and take care to observe what works and what doesn&#8217;t.</p>
<p>I was also involved with a great presentation by <a href="http://blog.jms.id.au/">Joel Stanley</a>. Joel is running <a href="https://blog.jms.id.au/2013/02/freedv-on-android/">FreeDV on an Android phone</a>, using a <a href="http://blog.jms.id.au/2013/02/building-a-double-sideband-reciever/">homebrew Double Sideband (DSB) receiver</a>.</p>
<p>Several people approached me after Joel&#8217;s presentation and commented on how they enjoyed Joel&#8217;s simple explanation of how radio receivers work. I noticed that Linux users are naturally interested in radio, and how things work in general.  So a good approach for an engaging talk at LCA is to explain how technology used on the periphery of Linux works.  Demystify it, make it less of a black box for the smart, but not domain aware LCA audience.</p>
<p>I would like to make a special thank you to <a href="http://rfhead.net">Mark</a>, V5KQI, who operated  a radio transmitter so Joel and I could demonstrate FreeDV at LCA.  Mark has also been very helpful with FreeDV testing and the development of Joel&#8217;s FreeDV on Android project.</p>
<p>Given the strong interest in radio topics, a conversation with Tridge lead to the idea of a radio miniconf for LCA 2014.  Some possible topics:</p>
<ul>
<li>Get your Foundation license at lca.conf.au</li>
<li>GNU radio tutorial</a>
<li>FreeDV</li>
<li>Build (solder) a SDR radio kit for the Ham, CB, or ISM bands.</a>
</ul>
<p><strong>Keynotes</strong></p>
<p>A very good set of keynotes (<a href="http://mirror.linux.org.au/linux.conf.au/2013">available</a> to view on line).  They showed some really tough problems where progress were unfortunately being blocked by human nature.  For example:</p>
<ul>
<li>Bdale Garbee covered (among other things) the lack of adoption of Linux on the desktop.  One of the main reasons is that companies selling Windows PCs in high volume actually get income from Windows and demo-ware.  Windows is a profit centre, not a cost. So selling a PC with Linux installed actually loses money!</li>
<li><a href="http://en.wikipedia.org/wiki/Radia_Perlman">Radia Perlman</a> spoke about networking protocols, and they are standardised.  A key take away was that standards we consider to be sacred are often handed down by committees behaving like &#8220;drunken sports fans&#8221;!  A funny and engaging talk.</li>
</ul>
<p>Here is nice picture I took during the Speakers Dinner at the top of the Telstra Tower overlooking Canberra.  LCA really does treat it&#8217;s speakers nicely:</p>
<p align=center><img src="/images/lca2013_sunset.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2840</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2013/ogv/Open_Source_Digital_Radio.ogv" length="124356199" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2013/mp4/Open_Source_Digital_Radio.mp4" length="83215669" type="video/mp4" />
		</item>
		<item>
		<title>Coherent PSK Demodulation on HF</title>
		<link>http://www.rowetel.com/blog/?p=2815</link>
		<comments>http://www.rowetel.com/blog/?p=2815#comments</comments>
		<pubDate>Sun, 20 Jan 2013 22:55:53 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2815</guid>
		<description><![CDATA[<p>This post is rather technical, and assumes a knowledge of PSK demodulator design. I apologise if it is difficult to understand for the general reader.  I have spent the last few weeks working on this part time so felt compelled to record the results somewhere.  Thanks to Bill Cowley VK5DSP and Peter Martinez G3PLX <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2815">Coherent PSK Demodulation on HF</a></span>]]></description>
			<content:encoded><![CDATA[<p>This post is rather technical, and assumes a knowledge of PSK demodulator design. I apologise if it is difficult to understand for the general reader.  I have spent the last few weeks working on this part time so felt compelled to record the results somewhere.  Thanks to Bill Cowley VK5DSP and Peter Martinez G3PLX for their email advice on this work.</p>
<p>I have a background in modems for satellite communications, which use non differential PSK and coherent demodulation.  This has a 3dB advantage over DPSK, at the cost of additional complexity.  The <a href="?page_id=2458">FDMDV modem</a> used for <a href="http://freedv.org/tiki-index.php">FreeDV</a> uses Differential Phase Shift Keying (DPSK).  This is the usual choice for HF radio channels which have phase distortion due to multipath propagation.  However 3dB is a big potential improvement, so I couldn&#8217;t help wondering if coherent demodulation would work for HF radio channels.  So I wrote some Octave code to try it.</p>
<p>First I needed to develop a phase estimation algorithm that could be bolted onto the FDMDV demodulator, but using the same DPSK modulator and over the air specification.  True coherent demodulation requires a unique word to resolve phase ambiguities.  This isn&#8217;t possible with the current FDMDV modem specification as there are no spare bits.  So I went for a pseudo coherent scheme where we coherently demodulate the PSK symbols, then pass them to a DPSK decoder.  This has a performance hit compared to coherent PSK, but resolves the phase ambiguity without a unique word.</p>
<p>The function rx_est_phase() in <a href="https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev/octave/fdmdv.m">fdmdv.m</a> estimates the phase over a window of Nph symbols.  </p>
<p>As a first step I plotted the scatter diagram of DPSK (top) versus pseudo coherent DPSK (bottom) for data from a real HF channel.  </p>
<p align=center><img src="/images/codec2/coherent/differential.png" /></p>
<p align=center><img src="/images/codec2/coherent/coherent.png" /></p>
<p>The psuedo coherent  scatter plot looked a bit better to me so I decided to go a little further.  I implemented a <a href="https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev/octave/fdmdv_ut_coh.m">demodulator simulation</a> that could measure bit error Rate (BER) for AWGN channels.  During development I found that the phase estimator couldn&#8217;t be used to track frequency offsets larger than 0.5 Hz. I think this is because of the low 50 Hz symbol rate.  So the existing DPSK demodulator was run in parallel to provide frequency offset tracking.</p>
<p>Here are the BER results for two Eb/No values (5 and 7 dB) for the two different algorithms.</p>
<table>
<tr>
<th>Demod</th>
<th>7dB</th>
<th>5dB</th>
</tr>
<tr>
<td>Differential</td>
<td>0.0128</td>
<td>0.0487</td>
</tr>
<tr>
<td>Pseudo Coherent</td>
<td>0.0068</td>
<td>0.0252</td>
</tr>
</table>
<p>The bit error rates are about half, which is a 1dB improvement.  This is not very much, but I decided to &#8220;run it to ground&#8221; and test using some FDMDV modem data from real HF channels.  <a href="http://rfhead.net/">Mark VK5QI</a> kindly gathered these samples for me.  Rather than Codec 2 data, a known test sequence is transmitted so BER can be determined at the receiver.  The <a href="https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev/octave/fdmdv_demod_coh.m">fdmdv_demod_coh.m</a> script implements a demodulator that uses sample files as input.</p>
<p>Here are the results for 50W Tx power (VK2-VK5_20m_50W_TX.raw) using 1400*10 bits.  The &#8220;Nph&#8221; parameter is the size of the window used to estimate the phase.  More symbols means a smoother estimate but a slower response to phase variations.</p>
<table>
<tr>
<th>Demod</th>
<th>BER</th>
</tr>
<tr>
<td>Differential</td>
<td>0.0541</td>
</tr>
<tr>
<td>Pseudo Coherent Nph=5</td>
<td>0.0517</td>
</tr>
<tr>
<td>Pseudo Coherent Nph=7</td>
<td> 0.0484</td>
</tr>
<tr>
<td>Pseudo Coherent Nph=9</td>
<td> 0.0442</td>
</tr>
<tr>
<td>Pseudo Coherent Nph=13</td>
<td> 0.0458</td>
</tr>
</table>
<p>Not a very impressive improvement, at best a 20% improvement in BER.  The results with 18W of Tx power (VK2-VK5_20m_18W_TX.raw) using 1400*10 bits are also marginal:</p>
<table>
<tr>
<th>Demod</th>
<th>BER</th>
</tr>
<tr>
<td>Differential</td>
<td>0.0991</td>
</tr>
<tr>
<td>Pseudo Coherent Nph=9</td>
<td>0.0926</td>
</tr>
</table>
<p>On the HF channel we have multipath pushing FDM carriers down into the noise. My guess is that the HF channel can be modelled as either good, where the SNR is high, or bad, where a fade knocks out one of the FDM carriers entirely.  A small improvement in demodulator performance only affects the transition between the two states.  </p>
<p>So, the next step in improving FreeDV performance is to explore Forward Error Correction (FEC).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2815</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>My First FreeDV Contact</title>
		<link>http://www.rowetel.com/blog/?p=2800</link>
		<comments>http://www.rowetel.com/blog/?p=2800#comments</comments>
		<pubDate>Sat, 15 Dec 2012 09:41:13 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2800</guid>
		<description><![CDATA[<p>A very pleasant Ham Radio day.  My friends Joel and Mark (VK5QI) visited my home to build Peter Parkers (VK3YE) &#8220;Porta 40&#8243; DSB receiver (from the November 2012 issue of &#8220;Amateur Radio&#8221; magazine).  Joel did the assembly work, with Mark and I helping test the receiver.  </p>
<p align=center></p>
<p>We started with the local oscillator, <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2800">My First FreeDV Contact</a></span>]]></description>
			<content:encoded><![CDATA[<p>A very pleasant Ham Radio day.  My friends <a href="http://jms.id.au/wiki">Joel</a> and <a href="http://rfhead.net/">Mark</a> (VK5QI) visited my home to build <a herf="http://home.alphalink.com.au/~parkerp/vk3ye">Peter Parkers</a> (VK3YE) &#8220;Porta 40&#8243; DSB receiver (from the November 2012 issue of &#8220;Amateur Radio&#8221; magazine).  Joel did the assembly work, with Mark and I helping test the receiver.  </p>
<p align=center><img src=/images/ham/porta_40.jpg /></p>
<p>We started with the local oscillator, and checked it could be heard on a nearby SSB radio.  We then built the RF Amp, mixer, and AF Amp.  We tested the mixer with the use of a signal generator (an Arduino controlled DDS) and an oscilloscope and verified the mixer loss was just a few dB.  An oscilliscope was used to verify each amplifier stage had gain. At the end of the day we connected the receiver to an outdoor antenna and were surprised to hear Ham radio signals on the 40m band! It felt very satisfying &#8211; I think we were all a bit surprised that it worked!  I enjoyed working with Joel and Mark &#8211; we all brought different skills to the project and worked well as a team.  I took care of catering &#8211; cooking a nice curry for lunch and keeping the coffee flowing.</p>
<p><strong>First FreeDV Contact</strong></p>
<p>For the last few days I have been trying to make some contacts on the HF bands using my FT817 5W radio and various antennas, including a long wire (with antenna tuner), a commercial end-fed trap diople, and a magnetic loop.  The long wire and dipole are propped up at one end with a 7m &#8220;squid pole&#8221; type fibreglass fishing rod:</p>
<p align=center><img src=/images/ham/squid_pole.jpg /></p>
<p>I could hear quite a few signals, but no one could hear me.  I think the problem was low power and low antenna height. This <a href="http://websdr.comms.net.au:8901/">WebSDR</a> receiver located about 800km away has been very useful.  It lets me visualise big chunks of the band for signals I could transmit CW and SSB to it to test various antennas, listening to the results through my laptop.</p>
<p>Mark brought along his 100W Icom HF SSB Radio to try a little more power. While connecting his radio to my antenna we noticed some activity on the 20m band that sounded like <a href="http://freedv.org">FreeDV</a>.  We connected his radio to my laptop and could visualise the BPSK sync part of the FreeDV signal,  but it was too weak to decode.  However we did learn that the band was open to VK2 (about 1500km away), so Mark IM-ed Brenton, VK2MEV, and we started a FreeDV contact, using about 10W of power at our end.</p>
<p>We experienced SNRs in the 5-10dB range with about 80% copy.  Some speech was lost when the fading got really bad.  The fading on the channel was changing all the time, fast to slow and back again. I think the other Hams running FreeDV just before us were Peter and friends, as described in <a href="http://blog.marxy.org/2012/12/first-hf-digital-voice-contact-with.html">Peter&#8217;s FreeDV blog post</a> today.</p>
<p>Being a speech coding guy I was initially unhappy with the coded speech quality but after a while I seemed to adjust and it seemed just fine.  The microphone EQ was useful in improving Brenton&#8217;s voice.  FreeDV was easy to operate and the colourful GUIs make it interesting and fun.   </p>
<p>The tx/rx switching was slower than Push To Talk (PTT) SSB, due to internal latencies and modem sync times, plus the VOX delay.  It would be hard to do any real time break in, but didn&#8217;t affect our conversation.  We switched to SSB to compare and were struck by the &#8220;hiss and crackle&#8221;, with fading on the analog audio also obvious.</p>
<p>Later in the day Mark and Brenton sent some test data frames over the same channel.  I will use this test data to start optimising FreeDV for low SNR channels.  Having known data means I can measure the bit error rate, and even extract patterns of bit errors that I can apply to off-line simulations of the system.  I can then compare different demodulation and FEC schemes before returning with the best candidates for some real world testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2800</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FreeDV</title>
		<link>http://www.rowetel.com/blog/?p=2782</link>
		<comments>http://www.rowetel.com/blog/?p=2782#comments</comments>
		<pubDate>Mon, 10 Dec 2012 20:06:56 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2782</guid>
		<description><![CDATA[<p>For the last 2 months I have been working with Dave Witten KD0EAG, coding a GUI application called FreeDV.  It combines Codec 2 and the FDMDV modem into single, user friendly application that runs on Linux and Windows.  It enables anyone with a SSB radio start using digital voice.</p>
<p align=centre></p>
<p>It works really well.  <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2782">FreeDV</a></span>]]></description>
			<content:encoded><![CDATA[<p>For the last 2 months I have been working with Dave Witten KD0EAG, coding a GUI application called <a href="http://freedv.org">FreeDV</a>.  It combines <a href="/codec2.html">Codec 2</a> and the <a href="?p=2458">FDMDV modem</a> into single, user friendly application that runs on Linux and Windows.  It enables anyone with a SSB radio start using digital voice.</p>
<p align=centre><img src="/images/codec2/freedv/screenshot-freedv-0.91-beta-2.png" /></p>
<p>It works really well.  FreeDV uses just 1100 Hz of bandwidth, much less that the 2400 Hz required for an analog SSB signal.  Compared to SSB it provides a &#8220;noise free&#8221; audio experience, and continues to work during fades and multipath at quite low SNRs.  Mel Whitten has experimented with many Digital Voice systems over the years.  This practical experience has led to the current design &#8211; a fast sync, no FEC, low latency system that gives a &#8220;SSB&#8221; type feel for operators.</p>
<p>Here is a video showing FreeDV in action, with analog SSB for comparison:</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/KBkgccjrABo?list=UUiHBhBaFZNClVz8-7eoKpmw&amp;hl=en_US" frameborder="0" allowfullscreen></iframe></p>
<p>It&#8217;s been a long time since I did any GUI programming and I found it a nice change from the command line signal processing work that I usually do.  The programing problems I had to solve didn&#8217;t involve maths or complex signal processing algorithms.  However bringing FreeDV to life has it&#8217;s own special problems, for example spending hours messing with wxWidgets &#8220;sizers&#8221; to get a check box positioned just right! It was also much larger than the usual program I work on, so there was a certain complexity navigating large files and keeping several balls in the air at once.</p>
<p>I have also really enjoyed working with a nice team of guys, including Dave Witten, <a href="http://www.melwhitten.com/">Mel Whitten</a> and <a href="http://perens.com/">Bruce Perens</a>.  Also involved were a wonderful group of alpha testers and kind people helping us document, support, and improve FreeDV.  One example is this fantastic <a href="http://www.youtube.com/watch?v=zijJ556cs08">FreeDV Getting Started</a> video produced by <a href="http://www.youtube.com/user/sandydiesel">Tony, K2MO</a>.</p>
<p>I also feel a sense of importance in our work &#8211; FreeDV is the only open source digital voice system for Amateur Radio.  It&#8217;s an opportunity to prevent Ham Radio (and digital voice over radio in general) being &#8220;locked down&#8221; to proprietary codecs.</p>
<p>Over the next few months we will gradually improve FreeDV.  In particular I would like work on improvements to the low SNR performance.  In the medium term I am interested in other applications for narrowband digital voice over radio, such as telephony in the developing world.  Ham Radio is an ideal test bed for refining the algorithms and experimenting with integration of the various buildlng blocks.</p>
<p align=center><img src="/images/codec2/freedv/mode_dv_130p.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2782</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>HTML Bison Adventure</title>
		<link>http://www.rowetel.com/blog/?p=2776</link>
		<comments>http://www.rowetel.com/blog/?p=2776#comments</comments>
		<pubDate>Fri, 07 Dec 2012 20:21:41 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2776</guid>
		<description><![CDATA[<p>My 14 year old son William likes animals and his favourite is the North American Bison.  He recently had to prepare a story for school.  I showed him how he could use HTML to write the story, pull in images from the Internet, and put options on each page for &#8220;what do you want <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2776">HTML Bison Adventure</a></span>]]></description>
			<content:encoded><![CDATA[<p>My 14 year old son William likes animals and his favourite is the North American Bison.  He recently had to prepare a story for school.  I showed him how he could use HTML to write the story, pull in images from the Internet, and put options on each page for &#8220;what do you want to do next&#8221; that linked to different narratives.  It was a good way for him to learn HTML and he scored an &#8220;A&#8221;.  <a href="http://rowetel.com/wd/bison_story/">Here</a> is the story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2776</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
