<?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>Thu, 10 May 2012 21:36:02 +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>Web Site Updates</title>
		<link>http://www.rowetel.com/blog/?p=2579</link>
		<comments>http://www.rowetel.com/blog/?p=2579#comments</comments>
		<pubDate>Thu, 10 May 2012 21:36:02 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2579</guid>
		<description><![CDATA[<p>I am about to head to Dayton for the Hamvention, so took the opportunity to bring my web site up to date.  The Codec 2 page includes our latest plans on building a Linux/Windows GUI Application for HF Digital Voice, has updates on recent algorithm developments, links to conference videos, and lots of figures explaining <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2579">Web Site Updates</a></span>]]></description>
			<content:encoded><![CDATA[<p>I am about to head to Dayton for the <a href="http://www.hamvention.org/">Hamvention</a>, so took the opportunity to bring my web site up to date.  The <a href="/codec2.html">Codec 2</a> page includes our latest plans on building a Linux/Windows GUI Application for HF Digital Voice, has updates on recent algorithm developments, links to conference videos, and lots of figures explaining how Codec 2 works. I have added a <a href="/blog/?p=2499">FDMDV modem page</a>, and updated my <a href="/blog/?p=434">About Page</a> to reflect my current projects and motivation.  The <a href="/blog/?p=273">Media page</a> includes updates on recent conferences and radio interviews, and has a section on how <a href="/blog/?p=2381">this post</a> on busting my daughters party with a Fluksometer went viral around the world, ending up back at my local newspaper!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2579</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ISIF award for Dili Village Telco</title>
		<link>http://www.rowetel.com/blog/?p=2543</link>
		<comments>http://www.rowetel.com/blog/?p=2543#comments</comments>
		<pubDate>Tue, 08 May 2012 22:01:23 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2543</guid>
		<description><![CDATA[<p>This is somewhat old news but last September Fongtil and I won an award for our work on the Dili Village Telco.  Here is the ISIF press release.  We were selected from a group of about 50 ISIF funded projects for the award.  Here is a photo of Lemi (2nd from right) accepting <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2543">ISIF award for Dili Village Telco</a></span>]]></description>
			<content:encoded><![CDATA[<p>This is somewhat old news but last September Fongtil and I won an award for our work on the <a href="http://dili.villagetelco.org">Dili Village Telco</a>.  Here is the <a href="http://isif.asia/groups/isif/wiki/b1c52/ISIF_Award_2011__Celebrating_the_achievement_of_innovators_in_the_AP_region_.html">ISIF press release</a>.  We were selected from a group of about 50 ISIF funded projects for the award.  Here is a photo of Lemi (2nd from right) accepting the award in Nairobi, Kenya:</p>
<p align=center><img src="/images/timor/isif_award_2010.jpg"></p>
<p>Although this project was my first developing world deployment and I worked hard to make sure we did a good job, soaking up experience and knowledge from others where I could.  </p>
<p>I think we got it about 70% right.  Many things (ease of use, training, enthusiasm for local assembly and installation) worked really well.  However being an Engineer there are still some remaining &#8220;bugs&#8221;  I feel compelled to work on, for example there are still lingering issues with Wifi link quality, and a sustainable business model.  Importantly, I haven&#8217;t seen viral growth, either in Timor or other Village Telco deployments.  This is important for me &#8211; my goal for the Village Telco was to help a lot of people in the developing world get telephony. This can only happen if the local people embrace the technology and grow the networks themselves without reliance on grants or 1st world technical input. I do think many of the pieces for this are in place.  &#8220;The Engineer&#8221; in me would love to have a go at really fixing those remaining issues! Still, this award confirms we did pretty well over all.</p>
<p>Although the funded part of the project officially ended in 2011, Fongtil are continuing to work on the project using internal resources and have also secured a further ISOC grant.  They continue to train people, install nodes, evangelise with government (e.g. installing Mesh Potatoes in the National Parliament building), and have plans to fix the Wifi link issues in Dili:</p>
<p align=center><img src="/images/timor/2012_lemi_demo.jpg"></p>
<p>I have moved my time and attention to other projects for now, but would love to get back to Timor some time to help out if I can.  In the mean time <a href="http://villagetelco.org">Village Telco</a> development and deployment work continues in Timor Leste and around the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2543</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FDMDV Modem Page</title>
		<link>http://www.rowetel.com/blog/?p=2499</link>
		<comments>http://www.rowetel.com/blog/?p=2499#comments</comments>
		<pubDate>Mon, 07 May 2012 01:21:02 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2499</guid>
		<description><![CDATA[<p>I have added a FDMDV modem page to this web site, plus typed up a README_fdmdv.txt that explains all the files related to the modem and how to use them.  </p>
<p>This modem was &#8220;lost&#8221; a few years ago as the initial implementation was closed source. So I felt compelled to put a fair bit of <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2499">FDMDV Modem Page</a></span>]]></description>
			<content:encoded><![CDATA[<p>I have added a <a href="?page_id=2458">FDMDV modem page</a> to this web site, plus typed up a <a href="https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev/README_fdmdv.txt">README_fdmdv.txt</a> that explains all the files related to the modem and how to use them.  </p>
<p>This modem was &#8220;lost&#8221; a few years ago as the initial implementation was closed source. So I felt compelled to put a fair bit of effort into documenting the open source implementation I have been working on.  Building this modem was fun, just hard enough to be challenging but no real show stopper bugs and didn&#8217;t hurt my head like Codec 2 algorithm development.</p>
<p>Next step is to tweak Codec 2 to make it interface cleanly to the modem for some initial on-air tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2499</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Testing a FDMDV Modem</title>
		<link>http://www.rowetel.com/blog/?p=2433</link>
		<comments>http://www.rowetel.com/blog/?p=2433#comments</comments>
		<pubDate>Mon, 30 Apr 2012 23:29:30 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2433</guid>
		<description><![CDATA[<p>A key use for Codec 2 is digital voice over HF and VHF radio. A few months ago I figured we needed to get Codec 2 on the air.  With a PC, codec and modem software, two sounds cards, and a Single Sideband (SSB) radio it is possible to send and receive Digital Voice (DV) <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2433">Testing a FDMDV Modem</a></span>]]></description>
			<content:encoded><![CDATA[<p>A key use for <a href="/codec2.html">Codec 2</a> is digital voice over HF and VHF radio. A few months ago I figured we needed to get Codec 2 on the air.  With a PC, codec and modem software, two sounds cards, and a Single Sideband (SSB) radio it is possible to send and receive Digital Voice (DV) signals over HF radio.</p>
<p>This requires a HF modem optimised for digital speech, in particular fast sync, no multi-second training sequences, the ability to recover quickly after a fade, and no automatic re-transmit of &#8220;bad&#8221; packets.   <a href="http://n1su.com/fdmdv/">FDMDV</a> was a working system for HF Digital Voice from a few years ago, so seemed like a good starting point.  It embodies a lot of experience from Digital Voice pioneers like <a href="http://www.melwhitten.com/">Mel Whitten</a>.</p>
<p>FDMDV stands for Frequency Division Multiplexed Digital Voice. A FDM modem is a basically a bunch of slow modems running in parallel.  For example FDMDV has 14 carriers spaced 75 Hz apart, each running at 50 symbols/second.  Due to multipath problems on HF this approach works better than one carrier running at 14&#215;50 = 700 symbols/second.  On each symbol is encoded two bits using <a href="http://en.wikipedia.org/wiki/Phase-shift_keying#Differential_phase-shift_keying_.28DPSK.29">differential QPSK</a>, so the bit rate is 1400 bit/s.</p>
<p>A few months ago I started experimenting with GNU Octave simulations of parts of the FDMDV modem.  One thing led to another and I ended up writing an open source version of the FDMDV modem, based on the <a href="http://n1su.com/fdmdv/FDMDV_Docs_Rel_1_4b.pdf.<br />
">FDMDV spec</a>.</p>
<p>I am in the final stages of the C version of that modem, currently writing command line demo programs.  I am not sure what the &#8220;best&#8221; HF DV system would look like (Codec/FEC/protocol/modem) but I feel the best way to find out is build something and iterate on it.  Rather than concentrating on the Codec alone I wanted to get some real world HF DV experience to tune and evolve the system as a whole.</p>
<p>The cool thing about open source is it attracts the best in the field. I have been in regular contact with HF modem gurus like Peter Martinez G3PLX (<a href="http://en.wikipedia.org/wiki/PSK31">PSK31</a>), and Rick Muething KN6KB (<a href="http://www.winlink.org/WINMOR">WINMOR</a>) who have been very helpful with suggestions and support as I re-implemented the FDMDV modem.  Rick also has some great ideas for more advanced modulation schemes (trellis coded PSK) that would be nice to try later.  I have also had some great help from <a href="https://www.itr.unisa.edu.au/itrusers/bill/public_html/">Bill Cowley</a>, who has 25 years of PSK modem experience.</p>
<p><strong>Testing the Modem</strong></p>
<p>After developing the modem algorithms for about two months using GNU Octave I was ready to test over a real HF channel. So a few days ago I sent a wave file of the modem signal to Mel and Tony (K2MO).  They kindly played the tones over a 925 mile HF channel and sent me a recording of the received signal.  </p>
<p>I ran the files through my FDMDV modem code.  On the first pass the scatter diagram was a mess and the Bit Error Rate (BER) was about 10% &#8211; suspiciously high.</p>
<p>Then I noticed the timing offset was changing very quickly, as you can see in the plot below:</p>
<p align=center><img src="/images/codec2/fdmdv1/big_timing_error.png" /></p>
<p>The demod estimates the best time to sample the received symbols.  This is known as the &#8220;timing offset&#8221;.  In the real world the sample clocks used at the transmitter and receiver tend to be a little different, for example 8000 and 8001Hz.  In our case the sample clocks are in the sound device hardware used to play and record the modem signals.  So we expect the timing offset to drift a little.  I had been simulating just such problems during the modem development, for example testing clock differences of up to 2000 ppm (16Hz at an 8000 Hz sample rate).  </p>
<p>Now the demod code keeps an eye on the drift in the timing estimate, and reshuffles buffers every now and again to keep them from overflowing.  Hence the saw-tooth effect.</p>
<p>If we count how many &#8220;teeth per second&#8221; in the saw-tooth, we can estimate the difference in the transmit and receive sample clock.  I estimated about 2.5, of 40 samples each.  So in every second that&#8217;s 2.5&#215;40 = 100 samples, or a 100Hz difference, or 12500ppm!  It&#8217;s like the PC playing the signal was at 8000Hz and the sample rate of the PC receiving the signal was at 8100Hz.</p>
<p>I re-sampled the signal to correct the large sample clock offset using Sox:<br />
<code><br />
sox -r 8100 -s -2 for_david.raw -s -2 for_david_8000hz.raw rate -h 8000<br />
</code></p>
<p>and the results were perfect &#8211; 0 bit errors except for when there was SSB interference across the signal!  This was very exciting for me &#8211; the first verification that my modem actually worked over real HF channels.</p>
<p>Turns out some sound cards can&#8217;t accurately sample at 8000Hz.  This was something I had been warned of by my HF modem brains trust.  The solution is to use the 48000Hz sound card rate, which most soundcards seem to be better at.</p>
<p><strong>FDM Modem in Action</strong></p>
<p>Here are samples of the first 5 seconds of the <a href="/images/codec2/fdmdv1/mod_dqpsk5.wav">transmit</a> and <a href="/images/codec2/fdmdv1/for_david.wav">receive</a> modem signal.  Now look at the spectrogram of the received signal:</p>
<p align=center><img src="/images/codec2/fdmdv1/spectrogram.png" /></p>
<p>Time is along the x axis, frequency along the y axis. The &#8220;hotter&#8221; the colour, the stronger the signal.  Our FDM signal is the parallel red lines between 600 and 1700Hz.  Above the modem signal is some analog SSB.  You can hear this as the high frequency &#8220;Donald Duck&#8221; sound in the received signal. Now around 2.5 and 3.3 seconds there are strong bursts of SSB right on top of our signal, in the 0 to 1100 Hz range. </p>
<p>So how does our modem do?  The &#8220;Bit errors for test frames&#8221; and &#8220;Test Frame Sync&#8221; plots below tells the story:</p>
<p align=center><img src="/images/codec2/fdmdv1/sync_bit_errors.png" /></p>
<p>Look at the centre plot, it is a measure of bit errors for each test frame received by the demod.  Between 2.5 and 3.5 seconds you can see several error bursts.  However the demod recovered quickly after the SSB interference.  The BPSK sync and test Frame sync plots are unbroken, indicating our demo didn&#8217;t &#8220;lose it&#8221; during the interfering burst.  If this was Codec (digital voice) data we would hear some degraded speech, but the system would soldier on between interfering analog SSB bursts. Just what we want.</p>
<p>This sample also shows some of the accumulated wisdom that went into the FDMDV system design.  It is a narrow signal (just 1100Hz), so less sensitive to interference to adjacent users on the busy HF bands compared to a system using a full SSB bandwidth of say 2400Hz.  Narrow band means we can pack more energy into fewer carriers.  The signal to noise ratio is relatively high, and the BER due to gaussian type channel noise (AWGN) practically zero. Rather bit errors come from adjacent users and mutipath fading effects (the latter not illustrated here).</p>
<p>Next steps are to integrate the Codec and Modem into an easy to use GUI program for Windows and Linux.  This will help us obtain some real world experience which we can use to tune and further develop the entire system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2433</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Intermittent EV</title>
		<link>http://www.rowetel.com/blog/?p=2419</link>
		<comments>http://www.rowetel.com/blog/?p=2419#comments</comments>
		<pubDate>Wed, 29 Feb 2012 06:32:53 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Electric Vehicles]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2419</guid>
		<description><![CDATA[<p>A few months ago I was cruising along and my EV suddenly lost power.  It was like someone had pushed in the clutch.  I lifted the bonnet but the problem seemed to have gone and off I went again.  Then it happened again last week.  I suspected the throttle pot, as I <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2419">Intermittent EV</a></span>]]></description>
			<content:encoded><![CDATA[<p>A few months ago I was cruising along and my <a href="/ev.html">EV</a> suddenly lost power.  It was like someone had pushed in the clutch.  I lifted the bonnet but the problem seemed to have gone and off I went again.  Then it happened again last week.  I suspected the throttle pot, as I know they can wear or get dirty over time.  The speed controller can sense if this pot is open circuit and will shut down for safety reasons.  So I pulled off the connectors to the throttle pot and sprayed some circuit cleaner on them.  This seemed to fix the problem for a days.</p>
<p>Then just today it became really bad.  Stop-start, stop-start.  I could hear the contactor clunking so I knew the 12V circuit was OK.  Other possibilities were a loose connection in the battery pack or a bug in the (rather expensive) speed controller.  So I popped the bonnet and started poking around.  Then I noticed something.  By moving one wire I could hear a small relay clicking on and off rapidly.  This relay (I think, it&#8217;s been a while since I built the EV) supplies a &#8220;go&#8221; signal to the speed controller.  As I moved the relay it would click on and off, and the motor power would cut off.</p>
<p><align="center"><img src="/images/ev_bad_relay_joint.jpg" /></p>
<p>Then I wiggled the solder connections to the relay and sure enough one of them was loose.  Ah-ha!  A few minutes later the problem was solved.  A bad solder joint is not bad for 3.5 years electric driving I guess.  Shows how easy Electric Cars are to fix as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2419</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Busting Teenage Partying with a Fluksometer</title>
		<link>http://www.rowetel.com/blog/?p=2381</link>
		<comments>http://www.rowetel.com/blog/?p=2381#comments</comments>
		<pubDate>Tue, 07 Feb 2012 07:13:49 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Renewables]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2381</guid>
		<description><![CDATA[<p>On New Years Eve 2011 I was in Geelong at a restaurant, 800km from my home in Adelaide.  This year I happened to be away from my children, who were staying elsewhere in Adelaide while I was interstate.  My home was  supposedly vacant.  However I knew it was very hot in Adelaide <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2381">Busting Teenage Partying with a Fluksometer</a></span>]]></description>
			<content:encoded><![CDATA[<p>On New Years Eve 2011 I was in Geelong at a restaurant, 800km from my home in Adelaide.  This year I happened to be away from my children, who were staying elsewhere in Adelaide while I was interstate.  My home was  supposedly vacant.  However I knew it was very hot in Adelaide that day (40C) and I wondered if this would affect my power consumption, for example an increased duty cycle on the fridge.  I am just that sort of power-geek.</p>
<p>So I checked my <a href="https://www.flukso.net/">Fluksometer</a> via my 3G android phone.  I was surprised to see 1000W being used since 1pm &#8211; about what my Air-con uses.  I also noticed that around 7pm the power jumped by a few 100W, just like the lights had gone on, or perhaps the TV.</p>
<p>Looked like some one was in my home.  On New Years Eve.  Hmmmmmm.</p>
<p>The 24 hour plot below just was captured on (1 Jan) at 5:30pm, so it actually shows the tail end of the Dec 31 festivities.  You can see the 1000W consumption until it shoots up around 1900 hours, then the rapid, parentally-induced decline at around 2030 hours as explained below&#8230;..</p>
<p><align="centre"><img src="/images/flukso/amy_busted.png" /></p>
<p>I was fortunate to be at the restaurant with a couple of people expert in these situations.  Teenagers.  They suspected &#8220;Party&#8221;.  I was unsure. I called my beloved 16 year old daughter Amy to see if she &#8220;knew&#8221; anything about this phantom power problem.  My gut feel was to call my mother (Amy&#8217;s grandmother) and ask her to visit my home but I thought I&#8217;d give Amy the benefit of the doubt.  Amy said that she was at a friends house but would go around and check my house.  She was not keen on using her grandmother to resolve the issue.  Exactly 30 minutes later I received a text from her saying the air con and TV was on but she had switched them off.</p>
<p>By this stage half the restaurant (I was with a friend&#8217;s extended family) were crowded around my phone, watching the next development with excitement.  My teenage brains-trust were calling &#8220;Party&#8221; but there was no way to know for sure. Sure enough the power drops, down to about 180W.  About what the fridge motor uses.  However curiously, there was none of the regular fridge cycling on and off.  It was as if all the lights were off in the house but the fridge motor was running all the time to cool or freeze something.  </p>
<p>I returned to Adelaide the next day (1 Jan).  My home was very clean but I found a few tell-tale signs: disposable cups with sticky red liquid in them in one of the bins, a trace of the same red sticky stuff on my sink, and post it notes accidentally left on my fridge saying things like &#8220;Molly, you may have to open up another bottle&#8221;.</p>
<p>What happened to Amy?  Well to be honest I wasn&#8217;t very mad, just curious about the mystery.  I actually enjoyed the detective work side of guessing what was going on and finding supporting evidence.  Bart, the inventer of the Fluksometer, was rolling on the floor laughing when I told him the tale. </p>
<p>All my friends knew about the incident so when Amy joined me in Geelong for the next week she was teased relentlessly.  Eventually she came clean, and said:</p>
<p>&#8220;All my friends who didnt know Dad said &#8216;How could he do that?  Who measures power from across the country&#8217;?  Those that did know Dad said &#8216;He knows.  Dont worry!&#8217;&#8221;</p>
<p>&#8220;When I realised we were busted there was a mass exodus.  I was the last one out and could see a continuous line of teenagers stretched up the street over three blocks.&#8221;</p>
<p>One of Amys friends put it well: &#8220;You gotta get dumber parents Amy.&#8221;</p>
<p><strong>Links</strong></p>
<p><a href="https://www.flukso.net/">Flukso Web Site</a><br />
<a href="?p=135">Flukso – Wifi Household Power Logging</a><br />
<a href="?page_id=312">Buying a Fluksometer in Australia</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2381</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>linux.conf.au (LCA) 2012</title>
		<link>http://www.rowetel.com/blog/?p=2305</link>
		<comments>http://www.rowetel.com/blog/?p=2305#comments</comments>
		<pubDate>Fri, 27 Jan 2012 12:00:47 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2305</guid>
		<description><![CDATA[<p>Well, it&#8217;s that time of year again &#8211; my annual geek-week at linux.conf.au.  Every day there were many interesting talks to attend and many I had to miss.  I am currently catching the ones I missed by watching the LCA 2012 videos.</p>
<p>Keynotes and Open Source DSP</p>
<p>The Bruce Perens keynote had many good points on <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2305">linux.conf.au (LCA) 2012</a></span>]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s that time of year again &#8211; my annual geek-week at linux.conf.au.  Every day there were many interesting talks to attend and many I had to miss.  I am currently catching the ones I missed by watching the <a href="    http://mirror.linux.org.au/linux.conf.au/2012/">LCA 2012 videos</a>.</p>
<p><strong>Keynotes and Open Source DSP</strong></p>
<p>The <a href="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Bruce_Perens.ogv">Bruce Perens keynote</a> had many good points on why open source is becoming essential to our security and well-being in the 21st century.  These themes were expanded by the other keynote speakers.  Bruce stated that &#8220;open software is the only credible producer of software&#8221;, we can choose to be &#8220;slaves to tools or the people who control the tools&#8221;.  Watch the talk for more information on these memes.  </p>
<p>I am interested in &#8220;the art&#8221; of presentation (as distinct from the content) so was also interested in Bruce&#8217;s presentation style from that perspective.  He appeared on stage in a suit, which is uncommon in a geeky crowd.  It raised a few eyebrows. However Bruce then explained that &#8220;a suit at LCA&#8221; was a theatrical device to underscore the point that we, as an open source community, should be facing outward. Open source communities are good at talking to people within our community, but our image outside of that community is poor and misunderstood (e.g. not many people understand their email is relayed via open source, or how it helps security problems and can help preserve democracy).  Our external image must be improved.</p>
<p>Another great point by Bruce was how Open Source is now solving tough, previously opaque problems that were traditionally considered too hard due to patents or specialised knowledge.  All you need is one guy to really get into and understand the problem. Suddenly the voodoo evaporates.  People then know it&#8217;s possible &#8211; a problem that our peers have solved always appears easier.  This one guy publishes source and shares what he has learnt.  Others start to hack the code.  Bruce, much to my embarrassment (!), actually cited my DSP work as an example, for example <a href="?page_id=454">Oslec</a> for echo cancellation and projects like Codec 2.  When Oslec started I had many people tell me &#8220;it can&#8217;t be done&#8221;, &#8220;you need a DSP chip to do it in hardware&#8221;, or &#8220;it&#8217;s all covered by patents&#8221;.  The truth is that Open Source DSP algorithms are now out performing closed source competitors.  For example the <a href="http://opus-codec.org/">Opus</a> guys have developed a world-beating open source audio and voice codec.  More on that below.</p>
<p>Actually I really enjoyed all of the keynotes.  <a href="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Paul_Fenwick.ogv">Paul Fenwick</a> spoke on how our mind works, including topics like &#8220;decoy choices&#8221; and the &#8220;planning fallacy&#8221;, and how playing Tetris can help with traumatic experiences.  I also recommend you watch the keynotes by <a href="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Jacob_Appelbaum.ogv">Jacob Applebaum</a> and <a href="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Karen_Sandler.ogv">Karen Sandler</a>.</p>
<p>It was great to see <a href="http://jmspeex.livejournal.com/">Jean-Marc Valin</a> and <a href="http://people.xiph.org/~tterribe/">Timothy B. Terriberry</a> in person, presenting on the <a href="http://mirror.linux.org.au/linux.conf.au/2012/Opus_the_Swiss_Army_Knife_of_Audio_Codecs.ogv">Opus Codec</a>.  I wonder if this will be the &#8220;last&#8221; audio codec.  It&#8217;s open source, royalty and patent free, will be an IETF standard, codes speech and music signals from 6,000 bit/s up, and outperforms other codecs like MP3.</p>
<p><strong>Codec 2 talk</strong></p>
<p>As I mentioned above I am interested in how conference presentations work.  Like a lot of my work, I am inclined to experiment.  Try something different. Hack it. A presentation on <a href="/codec2.html">Codec 2</a>, like many presentations at LCA, has a strong technical component that is hard for the average LCA attendee to follow.  My Codec 2 work is an extension of my PhD research in speech coding.  It took me 3 years to get my head around speech coding for the PhD. So how do I communicate Codec 2 topics to a smart, but non-speech-coding aware audience?</p>
<p>One way to handle this is &#8220;tutorial&#8221; style.  You spend about half the talk bringing people up to speed on your technical topic.  Enough to explain in the second half how you applied Linux or open source to this field.  This is a common approach at LCA.  It can work well, but also means a lot to absorb for the audience.  This can be a challenge after a day (let alone a week) of great ideas and intellectual stimulation at a conference like LCA.</p>
<p>Instead of the tutorial approach I hit on a different idea. Rather than confine my talk to Codec 2 and DSP theory, I tried approaching Speech Coding from a variety of tangential topics that matter to LCA attendees.  I talked about codec patents, how Ham radio relates to Open Source, and finally a really easy to grasp graphical explanation of how the sinusoidal model used in Codec 2 works.  I left out a bunch of DSP topics, and didn&#8217;t even put up a block diagram of the codec. I wanted the audience to walk away knowing 3 or 4 things about speech coding really well, rather than try to cover the entire, technically deep, acronym rich subject at a shallow level.</p>
<p>This worked well. Really well in fact &#8211; my <a href="http://mirror.linux.org.au/linux.conf.au/2012/Codec_2_Open_Source_Speech_Coding_at_2400_bits_and_Below.ogv">Codec 2 talk</a>  was voted the best of the conference and I was asked to repeat it later in the week.  Wow! This was especially amazing for me as the voting is done by the attendees.  A nice way to start 2012 for me, after working through some tough personal issues in 2011.  Here are the <a href=" http://rowetel.com/downloads/lca_2012_codec2.odp">slides</a> for my Codec 2 LCA 2012 talk in Open Office format.</p>
<p><strong>How Good Was Your Conference Talk?</strong></p>
<p>It is important to me that my talks are well received.  For me it&#8217;s part of my job and I take it seriously.  Here is what I look for.  This applies mainly to conferences with multiple parallel threads where people have a choice in what they attend:</p>
<ul>
<li>Did I fill the room (or nearly so)?</li>
<li>Were people still asking questions at the end of your allocated time?  Extra points if people come up to you afterwards and ask more questions.  Even better if you get hustled off by the conference organisers because the next speaker is overdue to start.</li>
<li>Did some of the more popular speakers/major contributors to the conference attend the talk?</li>
<li>Was the applause loud and enthusiastic?</li>
</ul>
<p>Oh, and I also like to make my talks short and leave more time than usual for questions.  For example in a 50 minute slot I will time my talk to be 30 minutes rather than the nominal 40, allowing 20 minutes for questions.  I feel strongly that the audience should drive a good chunk of the talk through their questions. This feels much better to me than running over time and not allowing enough time for questions.</p>
<p><strong>21 Second Lightning Talk</strong></p>
<p>Lightning talks are a fun part of LCA.  These usually last 5 minutes. I had an idea for a lightning talk on my <a href="?page_id=17">Electric Car</a> that I wanted to try.  I figured I could get my talk done in 10-15 seconds.  Yes, I was experimenting with presentation styles again.  I wanted to use lots of slides connected with just a few words (normally we are encouraged to do it the other way around). This year I managed to get a lightning talk slot and presented the talk.  You can see it on the <a href="http://mirror.linux.org.au/linux.conf.au/2012/Lightning_talks.ogv">lightning talk video</a> starting at 50:20.  From when I start to when I stop talking is 21 seconds, not quite the sub-15 seconds I was aiming at.  I always was a bit talkative. However the applause was pretty loud so I think the idea worked!</p>
<p><strong>Codec 2 Hacking</strong></p>
<p>While at LCA Jean-Marc did some great LSP vector quantiser work for <a href="/codec2.html">Codec 2</a> and explained some of the techniques involved.  This was very useful, and will be part of Codec 2 soon. Thanks Jean-Marc!  </p>
<p><align=centre><img src="/images/lca_2012_at_nurias_house.jpg" /></p>
<p>At the end of the conference Bruce Perens (left), Timothy and Jean-Marc (right), came to stay for a few days at Nuria&#8217;s (centre) house.  It was really nice to have them all, we did some good work on Codec 2, and the dinner-time conversation (fuelled by Nuria&#8217;s fine lasagne and BBQ) was fascinating.  As Bruce pointed out, there is great value in the small number of open source speech coding guys meeting face to face.</p>
<p>I was a bit nervous travelling in the same car with Jean-Marc and Timothy.  People working on open source voice codecs are rare &#8211; so we figured we had 60% of the world&#8217;s open source codec guys in one car!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2305</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Bruce_Perens.ogv" length="265526679" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Paul_Fenwick.ogv" length="188417768" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Jacob_Appelbaum.ogv" length="399206178" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Keynote_Karen_Sandler.ogv" length="282178740" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Opus_the_Swiss_Army_Knife_of_Audio_Codecs.ogv" length="231922874" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Codec_2_Open_Source_Speech_Coding_at_2400_bits_and_Below.ogv" length="210518164" type="video/ogg" />
<enclosure url="http://mirror.linux.org.au/linux.conf.au/2012/Lightning_talks.ogv" length="285091349" type="video/ogg" />
		</item>
		<item>
		<title>28,000 Electric km</title>
		<link>http://www.rowetel.com/blog/?p=1782</link>
		<comments>http://www.rowetel.com/blog/?p=1782#comments</comments>
		<pubDate>Sat, 19 Nov 2011 20:21:44 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Electric Vehicles]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=1782</guid>
		<description><![CDATA[<p>I haven&#8217;t written much about my EV for a while as nothing much has happened.  It just goes and goes, and has just clocked over 28,000 electric km since it was converted.  This post is a collection of notes from my EV driving in 2011.</p>
<p>It&#8217;s been two years since I installed Lithium batteries and <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=1782">28,000 Electric km</a></span>]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t written much about <a href="?page_id=17">my EV</a> for a while as nothing much has happened.  It just goes and goes, and has just clocked over 28,000 electric km since it was converted.  This post is a collection of notes from my EV driving in 2011.</p>
<p>It&#8217;s been two years since I installed <a href="?p=142">Lithium batteries</a> and they have operated faultlessly.  I haven&#8217;t touched them.  It&#8217;s a bit deceiving actually, guess I should check the terminals or something.  But when it just goes and goes you get a bit complacent.  I don&#8217;t even have an ammeter or voltmeter at the moment.</p>
<p>This picture says it all &#8211; spider webs where the petrol used to go!</p>
<p align=center><img src="/images/ev_spider_web_petrol.jpg" /></p>
<p>However I realised I hadn&#8217;t taken the car in for a &#8220;service&#8221; since I finished the conversion to electric drive 3 years ago.  This is because there isn&#8217;t much to service in an EV, no oil, water, spark plugs, timing belts, heads to crack, water pumps, hoses, fuel pumps, or exhaust systems to corrode.  The only wearing parts are brakes and tyres.  So I took it down to my friends at Woodville Park Autos and they rotated the tyres, checked the brakes and replaced the wiper blades.  That&#8217;s the maintenance for 3 years and 28,000 km on an EV!</p>
<p>Earlier this year I did 108km of city driving on one charge, and the car still felt just fine.  So I am not sure what the range actually is.  One of those things I don&#8217;t really want to find out!</p>
<p>The 6.7 inch Advanced DC motor is adequate for a 60 km/hr commuter vehicle on the Adelaide plains.  It&#8217;s quick off the line on the flat but struggles up hills at say 80 km/hr.  OK for our terrain but I think I would put a 8 inch motor in next time. However this would require bigger Lithium batteries to provide enough current. </p>
<p>The feeling of &#8220;electric cruising&#8221; on a warm summer night is quite magical.  Windows down, a warm breeze in your face and no motor noise.</p>
<p>My daughter turned 16 recently and had her very first driving lesson in the EV:</p>
<p align=center><img src="/images/ev_learner.jpg" /></p>
<p>It&#8217;s much like an automatic to drive so a nice easy way to start.  I am sure EVs will play a much bigger part in her life time than ICE vehicles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=1782</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Codec 2 at 1400 bits/s</title>
		<link>http://www.rowetel.com/blog/?p=2255</link>
		<comments>http://www.rowetel.com/blog/?p=2255#comments</comments>
		<pubDate>Tue, 15 Nov 2011 00:37:12 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Telephony]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2255</guid>
		<description><![CDATA[<p>I&#8217;m in the process of releasing a 1400 bit/s version of Codec 2.  Through efficient quantisation of the LSPs I have reduced the bit rate from 2500 to 1400 bit/s with only a small change in quality.  This bit rate makes the codec very useful for digital voice over HF radio channels. </p>
<p>Here are <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2255">Codec 2 at 1400 bits/s</a></span>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of releasing a 1400 bit/s version of <a href="/codec2.html">Codec 2</a>.  Through efficient quantisation of the LSPs I have reduced the bit rate from 2500 to 1400 bit/s with only a small change in quality.  This bit rate makes the codec very useful for digital voice over HF radio channels. </p>
<p>Here are some samples:</p>
<table>
<tr>
<th>Codec</th>
<th>Male</th>
<th>Female</th>
</tr>
<tr>
<td>Original</td>
<td><a href="/downloads/codec2/hts1a.wav">male</a></td>
<td><a href="/downloads/codec2/hts2a.wav">female</a></td>
</tr>
<tr>
<td>Codec 2 V0.1A 2550 bit/s</td>
<td><a href="/downloads/codec2/hts1a_c2_v0.1a.wav">male</a></td>
<td><a href="/downloads/codec2/hts2a_c2_v0.1a.wav">female</a></td>
</tr>
<tr>
<td>Codec 2 V0.2 1400 bit/s</td>
<td><a href="/downloads/codec2/hts1a_1400.wav">male</a></td>
<td><a href="/downloads/codec2/hts2a_1400.wav">female</a></td>
</tr>
<tr>
<td>GSM Full rate 13000 bit/s</td>
<td><a href="/downloads/codec2/hts1a_gsm13k.wav">male</a></td>
<td><a href="/downloads/codec2/hts2a_gsm13k.wav">female</a></td>
</tr>
</table>
<p>GSM full rate is what you might have been using on your mobile phone a few years ago.  It&#8217;s a good example of &#8220;communications quality&#8221; speech.  Compared to GSM, Codec 2 does a reasonable job at just 10% of the bit rate.  There are some more samples on the <a href="/codec2.html">Codec 2 page</a>.</p>
<p>I think it&#8217;s possible to eventually push Codec 2 beneath 1000 bit/s with the same quality level.  Improvements in the speech quality of Codec 2 at 1400 and 2500 bit/s are also possible with further algorithm development.</p>
<p>Some factoids:</p>
<ul>
<li>At 1400 bit/s you can send 45 phone calls in the same bandwidth required for a standard 64 kbit/s phone channel.</li>
<li>1400 bit/s is 175 bytes/second.</li>
<li>A 30 second voice mail can be stored in 5250 bytes.</li>
<li>A 30 minute pod cast can be stored in 308 kbytes.</li>
<li>At 1400 bit/s Codec 2 uses 56 bit (7 byte) packets, sent every 40ms.  If used for VOIP the <a href="http://villagetelco.org/2009/11/factors-affecting-village-telco-performance/">RTP+UDP+IP overhead</a> is 40 bytes/packet.  So the payload is just 15 % of the total VOIP packet.</li>
</ul>
<p><strong>History</strong></p>
<p>Building a 1400 bit/s communications quality speech codec is a highlight of my career.  </p>
<p>My interest in speech coding started in 1989 just after I graduated from engineering.  I was working with a team or researchers on Mobilesat &#8211; one of the first satellite-based mobile phone services.  We were working mainly on the modems for the Mobilesat system.  Just at that point in history, it became possible to use digital speech rather than analog systems such as FM or SSB.  During the 1980&#8242;s breakthrough speech coding algorithms were developed that could deliver communications quality speech at less than 10 kbit/s.  At the same time, the invention of DSP chips meant we could (just) run these complex algorithms in real time.  Prior to that it took 30 minutes to process 3 seconds of speech on the PCs or workstations of the day.</p>
<p>Although I was meant to be working on sat-com modems, I was fascinated by speech coding; first the DSP hardware, then the challenges of real time implementation, then the speech coding algorithms themselves.</p>
<p>The <a href="http://en.wikipedia.org/wiki/Code-excited_linear_prediction">CELP</a> based speech codecs I built in the early 90&#8242;s could deliver communications quality speech at 9600 bit/s, or (with a significant drop in quality) run at 4800 bit/s.</p>
<p>So managing to get about the same quality at 1400 bit/s is a nice personal achievement for me. Giving it away to the world is even cooler.</p>
<p><strong>2500 to 1400 bits/s</strong></p>
<p>Here is the bit allocation of Codec 2 running at 2500 bit/s:</p>
<table>
<tr>
<th>Parameter</th>
<th>bits/frame</th>
</tr>
<tr>
<td>Spectral magnitudes (LSPs)</td>
<td>36</td>
</tr>
<tr>
<td>Energy</td>
<td>5</td>
</tr>
<tr>
<td>Voicing (updated each 10ms)</td>
<td>2</td>
</tr>
<tr>
<td>Fundamental Frequency (Wo)</td>
<td>7</td>
</tr>
<tr>
<td>Total</td>
<td>50</td>
</tr>
</table>
<p>The <a href="http://en.wikipedia.org/wiki/Line_spectral_pairs">Line Spectrum Pairs</a> (LSPs) dominate the bit rate so I focused my attentions there for a couple of weeks. Here is the bit allocation of Codec 2 running at 1400 bit/s:</p>
<table>
<tr>
<th>Parameter</th>
<th>bits/frame<br />(even sub-frame)</th>
<th>bits/frame<br />(odd sub-frame)</th>
<th>bits/frame</th>
</tr>
<tr>
<td>Spectral magnitudes (LSPs)</td>
<td>25</td>
<td>7</td>
<td>32</td>
</tr>
<tr>
<td>Energy</td>
<td>5</td>
<td>5</td>
<td>10</td>
</tr>
<tr>
<td>Voicing (updated each 10ms)</td>
<td>2</td>
<td>2</td>
<td>4</td>
</tr>
<tr>
<td>Fundamental Frequency (Wo)</td>
<td>7</td>
<td>3</td>
<td>10</td>
</tr>
<tr>
<td>Total</td>
<td>36</td>
<td>17</td>
<td>56</td>
</tr>
</table>
<p><strong>A Graphical Explanation of LSPs</strong></p>
<p>Rather than going into the math of LSPs let me explain graphically.  Here is a plot of 10 LSPs over 400ms of male speech:</p>
<p align=center><img src="/images/codec2/force_lsp.png" /></p>
<p>The LSPs were extracted from this section of male speech:</p>
<p align=center><img src="/images/codec2/force_speech.png" /></p>
<p>The segment is the word &#8220;force&#8221; from the male sample at the top of this post.</p>
<p>In our case there are 10 LSPs.  They are spread over 0 to 3500Hz.  Together they represent the spectrum of the speech signal at any given point in time.  They evolve over time as the speech signal changes, so we have to keep sending updated versions every 20ms or so.</p>
<p>Speech coding is the art of &#8220;what can we throw away&#8221;.  So the idea is to send each LSP frequency across the channel to the decoder with the minimum number of bits, but still maintain good speech quality.</p>
<p>Closely spaced LSPs represent peaks in the speech spectrum.  Our ear is very sensitive to these peaks so we must take special care with closely spaced LSPs.  In the example above, you can see LSPs 1 and 2 close together between frames 7 and 25, at the same time we have a high energy vowel.  You can also see LSPs 8&#038;9, and 9&#038;10 coming together during a consonant between frame 25 and 30.  This indicates two peaks in the spectrum at high audio frequencies.</p>
<p>The ear is more sensitive to low frequencies, so it turns out we can use a coarser representation (less bits) for higher frequency LSPs.  </p>
<p>There is another property that helps us. Perceptually important frames of voiced speech like vowels tend to change slowly.  This suggests that coding the difference between frames will lead to coding efficiencies, as the frame-frame differences are very small.</p>
<p><strong>Scalar and Vector Quantisation</strong></p>
<p>The 2500 bit/s version of Codec 2 uses scalar quantisers.  For example LSP 8 is &#8220;quantised&#8221; to one of 8 values represented by a table or array:</p>
<table align=center>
<tr>
<th>Index</th>
<th>LSP 8</th>
</tr>
<tr>
<td>0</td>
<td>2300</td>
</tr>
<tr>
<td>1</td>
<td>2400</td>
</tr>
<tr>
<td>2</td>
<td>2500</td>
</tr>
<tr>
<td>3</td>
<td>2600</td>
</tr>
<tr>
<td>4</td>
<td>2700</td>
</tr>
<tr>
<td>5</td>
<td>2800</td>
</tr>
<tr>
<td>6</td>
<td>2900</td>
</tr>
<tr>
<td>7</td>
<td>3000</td>
</tr>
</table>
<p>To quantise LSP 8, we find the closest value in the table, then send the index of that value.  For LSP 8 this requires 3 bits/frame for the 8 possible values.  The 2500 bit/s version of Codec 2 uses 36 bits total, with one table for each LSP. Because each LSP has it&#8217;s own quantiser table, it is known as scalar quantisation.</p>
<p>A Vector Quantiser (VQ) can be more efficient as it quantises several values at once, which can be referred to with just one index:</p>
<table align=center>
<tr>
<th>Index</th>
<th>LSP 1</th>
<th>LSP 2</th>
<th>LSP 3</th>
<th>LSP 4</th</tr>
<tr>
<td>0</td>
<td>325</td>
<td>425</td>
<td>700</td>
<td>1275</td>
</tr>
<tr>
<td>1</td>
<td>350</td>
<td>425</td>
<td>700</td>
<td>1225</td>
</tr>
<tr>
<td>.</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>.</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>4095</td>
<td>550</td>
<td>625</td>
<td>725</td>
<td>1100</td>
</tr>
</table>
<p>This example vector quantises LSPs 1 to 4 using a 12 bit (4096 entry) table.  VQs can be very efficient, as they quantise several values at once and can take into account correlations in the input data. The trade off is that VQs tend to be noisy, as the table entries may not quite match all of the values in the input vector. Also I have found designing a VQ that works well to be quite a challenge.  </p>
<p><strong>From 2500 to 1400 bit/s</strong></p>
<p>Here are some highlights of a couple of weeks of trial and error.  I am not claiming any of this is particularly original, just new or important to me so worth logging here:</p>
<p>I developed a 25 bit/frame quantiser using scalar quantisers for LSPs 1-4, then a 12 bit (4096 entry) Vector Quantiser (VQ) for LSPs 5-10. I used VQ for the higher LSPs, as they are less sensitive to quantisation noise.  I freely admit I don&#8217;t completely understand VQ, so there may be room for improvement here.</p>
<p>I found that I could &#8220;pre-quantise&#8221; or bandwidth expand the LSPs without any drop in quality.  For example if LSPs 5-10 are quantised to 100Hz steps there is no perceptual difference in the decoded speech. This suggests that quantising the LSPs to any finer resolution is a waste of bits &#8211; we can&#8217;t hear the difference.  I used this effect to design the 12 bit Vector Quantiser (VQ) for LSPs 5-10, that (for me at least) worked better than the same size VQ I designed with traditional minimum mean square error (MSE) training methods.</p>
<p>Then I started playing  with delta-time quantisation of LSPs.  During high energy, strongly voiced speech, the LSPs change slowly from frame to frame.  So I experimented with just transmitting this small change.</p>
<p>Perceptually important, closely spaced LSPs are really sensitive to quantisation noise.  Small changes in closely spaced LSPs can have a big effect on the decoded speech quality. Fortunately, during this sort of speech the frame to frame changes are very small. So for coding delta changes in LSPs I designed a VQ codebook by hand with the properties I wanted. I took the approach of constraining the VQ codebook to very small changes.  </p>
<p>Here are some of the delta-time codebook entries:</p>
<table align=center>
<tr>
<th>Index</th>
<th>LSP 1</th>
<th>LSP 2</th>
<th>LSP 3</th>
<th>LSP 4</th</tr>
<tr>
<td>0</td>
<td>-25</td>
<td>-25</td>
<td>-50</td>
<td>-50</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>-25</td>
<td>-50</td>
<td>-50</td>
</tr>
<tr>
<td>2</td>
<td>25</td>
<td>-25</td>
<td>-50</td>
<td>-50</td>
</tr>
<tr>
<td>3</td>
<td>-25</td>
<td>0</td>
<td>-50</td>
<td>-50</td>
</tr>
<tr>
<td>4</td>
<td>0</td>
<td>0</td>
<td>-50</td>
<td>-50</td>
</tr>
<tr>
<td>.</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>.</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>79</td>
<td>0</td>
<td>25</td>
<td>50</td>
<td>50</td>
</tr>
<tr>
<td>80</td>
<td>25</td>
<td>25</td>
<td>50</td>
<td>50</td>
</tr>
</table>
<p>This full codebook is <a href="http://freetel.svn.sourceforge.net/viewvc/freetel/codec2-dev/src/codebook/lspdt1-4.txt?revision=298">here</a>.</p>
<p>It&#8217;s a bit like counting in binary, except the base changes for each element of the vector. It&#8217;s probably not optimal, but it works.  As there are 81 values in the codebook it can be transmitted with 7 bits (entries 82 to 127 are not used).</p>
<p>Another twist &#8211; I discovered was that I could get away with just updating the lowest LSPs 1-4 on the delta frames.  On odd delta frames I just copy the previous values for the LSPs 5-10.  This means just 7 bits/frame are required on the odd frames for LSPs.</p>
<p>A further reduction came from delta-coding the pitch (fundamental frequency), as it also changes slowly during perceptually important voiced speech frames.  Just 3 bits on odd frames resulted in no loss of quality.</p>
<p><strong>Next Steps</strong></p>
<p>Over the next few weeks I will release a separate encoder/decoder version of 1400 bit/s Codec 2.  At the moment you can run the same algorithm using the &#8220;c2sim&#8221; simulation program:<br />
<code><br />
$ svn -r 306 co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2-dev<br />
$ cd codec2-dev &amp;&amp; ./configure &amp;&amp; make &amp;&amp; cd src<br />
$ ./c2sim ../raw/hts1a.raw &#45;-1400 -o hts1a_1400.raw<br />
$ ../script/playraw.sh hts1a_1400.raw<br />
</code></p>
<p>I&#8217;d really like to see Codec 2 combined with a modem and running over the HF bands.  Some early experimentation to get real world user feedback and rapid development of an &#8220;open&#8221; digital voice mode would be great.  This mode could be implemented as a Linux or Windows PC application that uses two sound cards to connect to a SSB radio and head set.</p>
<p>A key issue to explore is robustness to bit errors. I favour unequal error protection modes, for example just a small amount of FEC that protects just a few key bits.</p>
<p>There are many areas where Codec 2 could be improved.  The LSP quantisation could be developed further to improve the quality or lower the bit rate.  I&#8217;d also like to work on the model used to synthesis phases at the decoder, and track down some issues with different speakers.</p>
<p><strong>Links</strong></p>
<p><a href="/codec2.html">Codec 2 Project Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2255</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>My IP04 hacked and SIP ALG</title>
		<link>http://www.rowetel.com/blog/?p=2210</link>
		<comments>http://www.rowetel.com/blog/?p=2210#comments</comments>
		<pubDate>Sat, 22 Oct 2011 21:12:08 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Telephony]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.rowetel.com/blog/?p=2210</guid>
		<description><![CDATA[<p>Well this is a bit embarrasing.  I make and sell embedded Asterisk boxes.  My IP04 has been hacked! Some one made a bunch of calls to Guyana, among other places:</p>

Call Summary

Destination
Calls
Amount


Algeria &#8211; Mobile Orascom
1
$0.39


Algeria &#8211; Mobile Wataniya
1
$0.59


Australia &#8211; 13/1300
2
$0.52


Australia &#8211; Adelaide
14
$1.82


Australia &#8211; Mobile
2
$3.18


Cape Verde &#8211; Mobile
1
$0.34


Cayman Is &#8211; Mobile C&#038;W
1
$0.21


Dominica
1
$0.27


East Timor
1
$0.50


Guyana &#8211; Mobile
47
$16.91


Ireland &#8211; <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.rowetel.com/blog/?p=2210">My IP04 hacked and SIP ALG</a></span>]]></description>
			<content:encoded><![CDATA[<p>Well this is a bit embarrasing.  I <a href="?page_id=440">make and sell</a> embedded Asterisk boxes.  My IP04 has been hacked! Some one made a bunch of calls to Guyana, among other places:</p>
<table>
<h2>Call Summary</h2>
<tr>
<th width="80%">Destination</th>
<th width="10%">Calls</th>
<th width="10%">Amount</th>
</tr>
<tr>
<td>Algeria &#8211; Mobile Orascom</td>
<td>1</td>
<td>$0.39</td>
</tr>
<tr>
<td>Algeria &#8211; Mobile Wataniya</td>
<td>1</td>
<td>$0.59</td>
</tr>
<tr>
<td>Australia &#8211; 13/1300</td>
<td>2</td>
<td>$0.52</td>
</tr>
<tr>
<td>Australia &#8211; Adelaide</td>
<td>14</td>
<td>$1.82</td>
</tr>
<tr>
<td>Australia &#8211; Mobile</td>
<td>2</td>
<td>$3.18</td>
</tr>
<tr>
<td>Cape Verde &#8211; Mobile</td>
<td>1</td>
<td>$0.34</td>
</tr>
<tr>
<td>Cayman Is &#8211; Mobile C&#038;W</td>
<td>1</td>
<td>$0.21</td>
</tr>
<tr>
<td>Dominica</td>
<td>1</td>
<td>$0.27</td>
</tr>
<tr>
<td>East Timor</td>
<td>1</td>
<td>$0.50</td>
</tr>
<tr>
<td>Guyana &#8211; Mobile</td>
<td>47</td>
<td>$16.91</td>
</tr>
<tr>
<td>Ireland &#8211; VOIP</td>
<td>1</td>
<td>$0.11</td>
</tr>
</table>
<p>I hadn&#8217;t taken any special secuity precautions with this IP04 as it&#8217;s behind a NAT broadband router.  It&#8217;s used for development and testing on my LAN and mesh networks so I don&#8217;t want it too restricted.  However it&#8217;s also used for VOIP calls to the outside world, so has a SIP connection to <a href="http://www.jazmin.com.au">Jazmin Commnications</a>, my ITSP.</p>
<p>Mike at Jazmin caught the attack early and disabled my account.  I was interstate at the time and couldn&#8217;t reach the box remotely.  So I asked my daughter to power down my entire home network, just on case my whole LAN was compromised.  A few days later I returned home and started looking into the problem. </p>
<p>I poked around the GUI of my (nearly new) NetComm NB6Plus4W router.  This was supplied by Internode, one of the most reputable ISPs here in Australia. One possibility was the &#8220;SIP ALG&#8221; option under the &#8220;Advanced&#8221; options:</p>
<p align=centre><img src="/images/sipalg.png" /></p>
<p>A bit of Googling on SIP ALG didn&#8217;t seem to suggest it was a huge security issue.  However several people suggested poor implementations of SIP ALG can break SIP.  It was on by default when I set up the router, so I hadn&#8217;t touched it.  And I really needed to find and if possible reproduce the attack before re-enabling my account to minimise the possibility of more abuse.  I was running out of ideas so I phoned Mike.  He suggested using <a href="http://code.google.com/p/sipvicious/">sipvicious</a> to investigate the problem.  I installed sipvicious on a Linux box on my LAN to get a feel for it, and tried a few commands from the <a href="http://code.google.com/p/sipvicious/wiki/GettingStarted">getting started</a> notes.  </p>
<p>Then I ran sipvicious on a remote Linux Box. It managed to detect my IP04, even though it was behind the firewall (note 121.45.13.78 is a fictional IP):<br />
<code><br />
ubuntu@ip:~/david/sipvicious$ ./svmap.py 121.45.13.78<br />
| 121.45.13.78:5060 | Asterisk PBX | Asterisk |<br />
</code></p>
<p>The svwar and svcrack tools didn&#8217;t work for me (they couldn&#8217;t find and crack my SIP user accounts) but svmap told me enough: the SIP 5060 port on my Asterisk box was visible to anyone on the Internet!</p>
<p>I tried disabling the router SIP ALG option and straight away svmap showed the security hole was gone:<br />
<code><br />
ubuntu@ip:~/david/sipvicious$ ./svmap.py 121.45.13.78<br />
WARNING:root:found nothing<br />
</code></p>
<p>If I re-enabled SIP-ALG nothing happened, but when I rebooted the router the problem returned.</p>
<p>I also had another (well actually several) security problems.  In /etc/asterisk/sip.conf I had &#8220;allowguest=no&#8221; commented out.  This meant that anonymous people could make &#8220;guest&#8221; SIP calls, with no authentication at all.  Great when I am messing around with Mesh Potatoes and want to set something up fast but not so clever when my IP04 is wide open to the Internet.</p>
<p>But I wanted to find the &#8220;smoking gun&#8221; &#8211; could some one really make a call through the open 5060 port?  I needed a command line tool to make calls from the remote Linux box.  So I used what I know &#8211; another Asterisk instance running on the remote Linux box.  </p>
<p>I added some dialplan to try to call my IP04 as the guest user:<br />
<code><br />
[default]<br />
exten =&gt; 4000,1,Dial(SIP/121.45.13.78/6004)<br />
</code></p>
<p>Then from the Asterisk CLI:</p>
<p>ip*CLI> console dial 4000</p>
<p>and &#8220;ring ring&#8221; when a phone connected to my IP04!  Ouch! Uncommenting &#8220;allowguest=no&#8221; and a &#8220;SIP reload&#8221; stoppped guest calls.  However I have to admit &#8211; the main protection I am relying on is the firewall, now working properly since disabling SIP ALG.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rowetel.com/blog/?feed=rss2&amp;p=2210</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

