<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Project MOPTAW</title>
  <subtitle>My Own Personal Thing a Week</subtitle>
  <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal"/>
  <link rel="self" type="application/atom+xml" href="http://bandgap.rsnsoft.com/drupal/atom/feed"/>
  <id>http://bandgap.rsnsoft.com/drupal/atom/feed</id>
  <updated>2008-10-30T18:28:36-07:00</updated>
  <entry>
    <title>Electret microphone preamp</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/74" />
    <id>http://bandgap.rsnsoft.com/drupal/node/74</id>
    <published>2010-04-23T22:48:16-07:00</published>
    <updated>2010-04-23T22:48:16-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>I'm working on a very preliminary electret mic preamp circuit for use with a TI eval board, the ADS1278 8-channel 24-bit ADC.<br />
I'm currently investigating noise levels due to power supply and interconnect, so I have the microphone out of the circuit.<br />
At 48 kHz, high-res mode, 8192 samples, onboard amp disabled, the histogram parameters are as follows, in units of least significant bits:<br />
Differential input shorted:<br />
ENOB 19.29<br />
noise-free bits 16.57<br />
Differential input to prototype board, mic disconnected:<br />
ENOB 15.56<br />
noise free bits 12.83<br />
Same as above, but with more circuitous ground path on protoboard:<br />
ENOB 15.43,15.6,13.06*,15.67<br />
noise free bits 12.7,12.87,10.34*,12.95<br />
*DSP board glitched<br />
Same as above, but with shielded twisted pair connection to dev board:<br />
ENOB 15.34, 15.37, 15.32, 15.52<br />
NFB 12.62, 12.65, 12.59, 12.8<br />
Same as above, but with my preamp's input grounded instead of seeing the 3.3V regulated supply through a decoupling cap:<br />
ENOB: 16.39, 16.15, 16.08, 16.67<br />
NFB 13.66, 13.43, 13.35, 13.95<br />
So, limiting factor is currently the 3.3v regulator.<br />
Looking back to the capacitor-coupled 3.3v regulator input, I see noise at 12.45 Hz and harmonics. Then there are other spikes centered at 216.8 Hz with 12.6 Hz spacings. Curious. The amplitudes are far too low to see on my scope, even after amplification. Looking at the signal in the time domain makes it pretty obvious I'm seeing artifacts from the switching regulator on the dev board making it through the 3.3v. I clearly need a cleaner supply one way or another.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I'm working on a very preliminary electret mic preamp circuit for use with a TI eval board, the ADS1278 8-channel 24-bit ADC.</p>
<p>I'm currently investigating noise levels due to power supply and interconnect, so I have the microphone out of the circuit.</p>
<p>At 48 kHz, high-res mode, 8192 samples, onboard amp disabled, the histogram parameters are as follows, in units of least significant bits:</p>
<p>Differential input shorted:<br />
ENOB 19.29<br />
noise-free bits 16.57</p>
<p>Differential input to prototype board, mic disconnected:<br />
ENOB 15.56<br />
noise free bits 12.83</p>
<p>Same as above, but with more circuitous ground path on protoboard:<br />
ENOB 15.43,15.6,13.06*,15.67<br />
noise free bits 12.7,12.87,10.34*,12.95</p>
<p>*DSP board glitched</p>
<p>Same as above, but with shielded twisted pair connection to dev board:<br />
ENOB 15.34, 15.37, 15.32, 15.52<br />
NFB 12.62, 12.65, 12.59, 12.8</p>
<p>Same as above, but with my preamp's input grounded instead of seeing the 3.3V regulated supply through a decoupling cap:<br />
ENOB: 16.39, 16.15, 16.08, 16.67<br />
NFB 13.66, 13.43, 13.35, 13.95</p>
<p>So, limiting factor is currently the 3.3v regulator.</p>
<p>Looking back to the capacitor-coupled 3.3v regulator input, I see noise at 12.45 Hz and harmonics. Then there are other spikes centered at 216.8 Hz with 12.6 Hz spacings. Curious. The amplitudes are far too low to see on my scope, even after amplification. Looking at the signal in the time domain makes it pretty obvious I'm seeing artifacts from the switching regulator on the dev board making it through the 3.3v. I clearly need a cleaner supply one way or another.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Some quick notes on using a Telit GM862 cellular module with T-Mobile USA</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/73" />
    <id>http://bandgap.rsnsoft.com/drupal/node/73</id>
    <published>2010-01-17T00:50:59-08:00</published>
    <updated>2010-01-17T00:50:59-08:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>I recently got a <a href="http://www.telit.com/en/products/gsm-gprs.php?p_id=12&amp;p_ac=show&amp;p=7">Telit GM862-GPS</a> module. This is a GSM cellular module with built-in GPS. It took a bit of poking around to get it to work with my T-Mobile SIM card, so here's a quick list of commands that I finally was successful with.</p>
<pre><b>AT#BND=1</b> # Set US frequency band
OK
<b>AT+CGDCONT=1,"IP","epc.tmobile.com","0.0.0.0",0,0</b> # Configure GPRS context with T-Mobile's APN
OK
<b>AT+CGQMIN=1,0,0,3,0,0</b> # Set some default QoS parameters
OK
<b>AT#QDNS="google.com"</b> # Quick test of GPRS using the built-in DNS client
#QDNS: "google.com","74.125.45.104"

OK
<b>AT#SGACT=1,1</b> # Activate GPRS context 1 for EasyGPRS operation
#SGACT: 25.128.19.217

OK
<b>AT#SD=1,0,80,"www.google.com",0,0</b> # Connect to google on port 80
CONNECT
<b>GET /</b> # Send CRLF after this
&lt;!doctype html&gt;&lt;html&gt;&lt;head&gt;&lt;meta http-equiv="content-type"  etc etc etc
NO CARRIER
<b>AT#SGACT=1,0</b> # Deactivate GPRS context
OK
</pre>    ]]></summary>
    <content type="html"><![CDATA[<p>I recently got a <a href="http://www.telit.com/en/products/gsm-gprs.php?p_id=12&amp;p_ac=show&amp;p=7">Telit GM862-GPS</a> module. This is a GSM cellular module with built-in GPS. It took a bit of poking around to get it to work with my T-Mobile SIM card, so here's a quick list of commands that I finally was successful with.</p>
<pre><b>AT#BND=1</b> # Set US frequency band
OK
<b>AT+CGDCONT=1,"IP","epc.tmobile.com","0.0.0.0",0,0</b> # Configure GPRS context with T-Mobile's APN
OK
<b>AT+CGQMIN=1,0,0,3,0,0</b> # Set some default QoS parameters
OK
<b>AT#QDNS="google.com"</b> # Quick test of GPRS using the built-in DNS client
#QDNS: "google.com","74.125.45.104"

OK
<b>AT#SGACT=1,1</b> # Activate GPRS context 1 for EasyGPRS operation
#SGACT: 25.128.19.217

OK
<b>AT#SD=1,0,80,"www.google.com",0,0</b> # Connect to google on port 80
CONNECT
<b>GET /</b> # Send CRLF after this
&lt;!doctype html&gt;&lt;html&gt;&lt;head&gt;&lt;meta http-equiv="content-type"  etc etc etc
NO CARRIER
<b>AT#SGACT=1,0</b> # Deactivate GPRS context
OK
</pre>    ]]></content>
  </entry>
  <entry>
    <title>MOPTAW: Halloween edition</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/72" />
    <id>http://bandgap.rsnsoft.com/drupal/node/72</id>
    <published>2009-11-06T02:33:41-08:00</published>
    <updated>2009-11-06T02:33:41-08:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>This was a fun one! Sadly, I ran out of time before getting the eyes to flash, but the iris blink mechanism worked like a charm. I present to you Anne as #3 from <a href="http://en.wikipedia.org/wiki/9_(2009_film)">9</a>.<br />
<object width="445" height="364"></p>
<param name="movie" value="http://www.youtube.com/v/zlu2mh0hOrs&amp;hl=en&amp;fs=1&amp;rel=0&amp;border=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/zlu2mh0hOrs&amp;hl=en&amp;fs=1&amp;rel=0&amp;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object></p>
<p>The servo driver is a just a 555, based on <a href="http://www.repairfaq.org/filipg/RC/F_Servos.html">this circuit</a> (see section 3). The trigger is a double-throw switch which selects which trimpot controls the position. It's all gorped together with ShapeLock plastic.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>This was a fun one! Sadly, I ran out of time before getting the eyes to flash, but the iris blink mechanism worked like a charm. I present to you Anne as #3 from <a href="http://en.wikipedia.org/wiki/9_(2009_film)">9</a>.<br />
<object width="445" height="364"><br />
<param name="movie" value="http://www.youtube.com/v/zlu2mh0hOrs&amp;hl=en&amp;fs=1&amp;rel=0&amp;border=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/zlu2mh0hOrs&amp;hl=en&amp;fs=1&amp;rel=0&amp;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object></p>
<p>The servo driver is a just a 555, based on <a href="http://www.repairfaq.org/filipg/RC/F_Servos.html">this circuit</a> (see section 3). The trigger is a double-throw switch which selects which trimpot controls the position. It's all gorped together with ShapeLock plastic.</p>
    ]]></content>
  </entry>
  <entry>
    <title>May you save the 20 minutes I didn&#039;t</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/71" />
    <id>http://bandgap.rsnsoft.com/drupal/node/71</id>
    <published>2009-09-08T16:19:46-07:00</published>
    <updated>2009-09-08T16:19:46-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>Platform: Ubuntu 8.10 (intrepid)</p>
<p><blockcode>$ ruby --version<br />
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]</p>
<p>$ rcov --version<br />
rcov 0.8.1.2 2007-11-22</blockcode></p>
<p>Problem:</p>
<p><blockcode>$ rake spec<br />
34 examples, 0 failures, 5 pending<br />
...<br />
/usr/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `[]': no implicit conversion from nil to integer (TypeError)<br />
...</blockcode></p>
<p>Aha. It seems the 'rcov' gem is badly out of date. This bug has been reported since 2007.</p>
<p>Install this alternate version:</p>
<p><blockcode>$ gem sources -a <a href="http://gems.github.com" title="http://gems.github.com">http://gems.github.com</a><br />
<a href="http://gems.github.com" title="http://gems.github.com">http://gems.github.com</a> added to sources</p>
<p>$ gem install relevance-rcov<br />
...<br />
Successfully installed relevance-rcov-0.9.0<br />
...</p>
<p>$ rake spec<br />
...<br />
34 examples, 0 failures, 5 pending<br />
$</blockcode></p>
<p>Success!</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>Platform: Ubuntu 8.10 (intrepid)</p>
<p><blockcode>$ ruby --version<br />
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]</p>
<p>$ rcov --version<br />
rcov 0.8.1.2 2007-11-22</blockcode></p>
<p>Problem:</p>
<p><blockcode>$ rake spec<br />
34 examples, 0 failures, 5 pending<br />
...<br />
/usr/lib/ruby/1.8/rexml/formatters/pretty.rb:131:in `[]': no implicit conversion from nil to integer (TypeError)<br />
...</blockcode></p>
<p>Aha. It seems the 'rcov' gem is badly out of date. This bug has been reported since 2007.</p>
<p>Install this alternate version:</p>
<p><blockcode>$ gem sources -a <a href="http://gems.github.com" title="http://gems.github.com">http://gems.github.com</a><br />
<a href="http://gems.github.com" title="http://gems.github.com">http://gems.github.com</a> added to sources</p>
<p>$ gem install relevance-rcov<br />
...<br />
Successfully installed relevance-rcov-0.9.0<br />
...</p>
<p>$ rake spec<br />
...<br />
34 examples, 0 failures, 5 pending<br />
$</blockcode></p>
<p>Success!</p>
    ]]></content>
  </entry>
  <entry>
    <title>EL wire experimentation</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/70" />
    <id>http://bandgap.rsnsoft.com/drupal/node/70</id>
    <published>2009-08-25T13:20:10-07:00</published>
    <updated>2009-08-25T13:20:10-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>I took a bit of <a href="http://en.wikipedia.org/wiki/Electroluminescent_wire">EL wire</a> and stripped off its outer jacket to reveal just the phosphor-coated copper wire, and used an alligator clip holding a single strand of wire to make the connection usually made by the tiny spiraled copper wires. Experiment details are after the video.<br />
<object width="560" height="340"></p>
<param name="movie" value="http://www.youtube.com/v/f5zwF9as7pc&amp;hl=en&amp;fs=1&amp;"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/f5zwF9as7pc&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I took a bit of <a href="http://en.wikipedia.org/wiki/Electroluminescent_wire">EL wire</a> and stripped off its outer jacket to reveal just the phosphor-coated copper wire, and used an alligator clip holding a single strand of wire to make the connection usually made by the tiny spiraled copper wires. Experiment details are after the video.<br />
<object width="560" height="340"><br />
<param name="movie" value="http://www.youtube.com/v/f5zwF9as7pc&amp;hl=en&amp;fs=1&amp;"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/f5zwF9as7pc&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object><br />
<!--break--><br />
I used a signal generator set to 20 Vpp connected to a 1:10 (approximately) step-up transformer. Note that although I held the amplitude of the signal generator constant the voltage impressed across the wire assembly varied by about a factor of 3, almost certainly due to resonance effects involving the capacitance of the EL wire and the transformer secondary. It would be interesting to re-run the tests with feedback control keeping the secondary AC voltage constant as the drive frequency changes.</p>
<p>I was expecting the brightness and color change effects. I unjacketed the wire specifically to see how much of it would glow based on a single secondary contact, but I was not expecting the length of the glowing region to change. It's also somewhat curious that there appeared to be "breaks" in the phosphor in that if the secondary wire was on one side of the break it would not glow on the other wide even if well within the range of glow effect expected given the frequency. (I put "break" in scare quotes because I couldn't actually see anything different in the wire with my naked eye.) </p>
<p>Future experiments:</p>
<ul>
<li>Regulate transformer secondary voltage, not primary, to remove the resonant voltage boost as a confounding factor in determining brightness.</p>
<li>Examine effects of harmonic content. Getting these through the transformer may be a challenge. I was using a wall wart transformer backward to get the voltage boost, so using a transformer optimized for a wider frequency range may help with this. Driving with a square wave instead of a sine wave produced brighter output, but I was not correcting for the increase in RMS voltage.
<li>Examine a longer segment of wire to see if the "breaks" in the phosphor are a regular occurrence, possibly due to manufacturing technique.
<li>Crease the wire to see if I can induce a "break" in the phosphor.
<li>See if varying the frequency of intact wire can induce a "candy-cane" striping effect with the glow only following the course of the secondary wires. (Please, if you experiment with this and come up with an effect that's the rage at burning man next year or something, drop me a kind word, preferably publicly. Thanks!)
</ul>
    ]]></content>
  </entry>
  <entry>
    <title>Generalizing the FFT (again)</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/69" />
    <id>http://bandgap.rsnsoft.com/drupal/node/69</id>
    <published>2009-07-31T20:44:26-07:00</published>
    <updated>2009-07-31T20:44:26-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>Turns out the twiddle factor pattern, <a href="/drupal/node/68">which I had thought was complicated</a>, is actually simple. It looked complicated only because rounding error was nudging the argument of the twiddles back and forth between +/- pi.</p>
<p>The graph shows arg(twiddle)/pi for each twiddle factor for the FFT and the CS-SCHT.<br />
<a href="http://www.flickr.com/photos/machack/3776999852/" title="Twiddle factors by machack, on Flickr"><img src="http://farm3.static.flickr.com/2468/3776999852_7405c9cd92.jpg" width="500" height="270" alt="Twiddle factors" /></a></p>
<p>The CS-SCHT's factors are just the FFT's factors quantized to [1, i, -1].</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>Turns out the twiddle factor pattern, <a href="/drupal/node/68">which I had thought was complicated</a>, is actually simple. It looked complicated only because rounding error was nudging the argument of the twiddles back and forth between +/- pi.</p>
<p>The graph shows arg(twiddle)/pi for each twiddle factor for the FFT and the CS-SCHT.<br />
<a href="http://www.flickr.com/photos/machack/3776999852/" title="Twiddle factors by machack, on Flickr"><img src="http://farm3.static.flickr.com/2468/3776999852_7405c9cd92.jpg" width="500" height="270" alt="Twiddle factors" /></a></p>
<p>The CS-SCHT's factors are just the FFT's factors quantized to [1, i, -1].</p>
    ]]></content>
  </entry>
  <entry>
    <title>Generalizing the FFT</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/68" />
    <id>http://bandgap.rsnsoft.com/drupal/node/68</id>
    <published>2009-07-31T00:12:35-07:00</published>
    <updated>2009-07-31T00:12:35-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>I've been looking at an article in IEEE signal processing: <a href="http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=5076146&amp;arnumber=4801666&amp;count=44&amp;index=13">Conjugate Symmetric Sequency-Ordered Complex Hadamard Transform</a> by Aung, Ng, and Rahardja.<br />
Basically they define a transform which shares a lot of properties with the Discrete Fourier Transform but only requires addition and subtraction to implement. In that respect it's like a sequency-ordered Walsh-Hadamard transform, but this one operates in the complex domain and shares symmetries with the DFT. It's kind of cool, but it doesn't have quite enough sidelobe rejection to be very useful for pitch detection above 16 bands or so.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I've been looking at an article in IEEE signal processing: <a href="http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=5076146&amp;arnumber=4801666&amp;count=44&amp;index=13">Conjugate Symmetric Sequency-Ordered Complex Hadamard Transform</a> by Aung, Ng, and Rahardja.</p>
<p>Basically they define a transform which shares a lot of properties with the Discrete Fourier Transform but only requires addition and subtraction to implement. In that respect it's like a sequency-ordered Walsh-Hadamard transform, but this one operates in the complex domain and shares symmetries with the DFT. It's kind of cool, but it doesn't have quite enough sidelobe rejection to be very useful for pitch detection above 16 bands or so.</p>
<p>While I was poking at implementing it, though, I noticed that although the transform is defined recursively for a fast implementation in the article, there seems to be a VERY close connection to the decimation-in-time FFT which I didn't see called out in the paper. (It may very well have been and I just missed it.)</p>
<p>Anyway, in a radix-2 DIT FFT the transform of length N is defined as a permutation operation followed by a pair of length N/2 DFTs followed by the "twiddle factors", which are just complex exponentials spaced at multiples of e^(-i*pi/(n/2)). (I'm too tired to look up the LaTeX embedding syntax right now.)</p>
<p>The interesting part is that the CS-SCHT transform in the article above can be expressed identically except that the twiddle factors are different. In the DFT the twiddle factors are a simple sequence of points on the unit circle. In the CS-SCHT all of the factors are +/- 1, except for one that's -i. (It's that property that makes it possible to implement without multiplication). I haven't figured out the pattern yet, but I'm curious to see what it is.</p>
<p>What this gives me, though, is a nice compact way of specifying FFT-like transforms in terms only of the requisite twiddle factors. That gives me a very powerful design technique for integer-friendly FFT-like transforms. More to follow someday.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Pitch estimation</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/67" />
    <id>http://bandgap.rsnsoft.com/drupal/node/67</id>
    <published>2009-07-12T21:32:45-07:00</published>
    <updated>2009-07-12T21:32:45-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>I'm working on a more sophisticated pitch estimation algorithm. The one used by <a href="https://bandgap.rsnsoft.com/drupal/node/55">the violin mod</a> worked, more or less, but was pretty hacky in order to run in real time on an AVR.<br />
Here's a comparison of the two on the same input clip. As you can see, the old one gave a rough-ish estimate of pitch, but very very noisily.<br />
Old algorithm:<br />
<a href="http://www.flickr.com/photos/machack/3715693644/" title="pitch_est_old by machack, on Flickr"><img src="http://farm3.static.flickr.com/2561/3715693644_5f021d6476_m.jpg" width="240" height="105" alt="pitch_est_old" /></a><br />
New algorithm:<br />
<a href="http://www.flickr.com/photos/machack/3715656030/" title="pitch_est by machack, on Flickr"><img src="http://farm3.static.flickr.com/2634/3715656030_167e394f6e_m.jpg" width="240" height="141" alt="pitch_est" /></a></p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I'm working on a more sophisticated pitch estimation algorithm. The one used by <a href="https://bandgap.rsnsoft.com/drupal/node/55">the violin mod</a> worked, more or less, but was pretty hacky in order to run in real time on an AVR.<br />
Here's a comparison of the two on the same input clip. As you can see, the old one gave a rough-ish estimate of pitch, but very very noisily.<br />
Old algorithm:<br />
<a href="http://www.flickr.com/photos/machack/3715693644/" title="pitch_est_old by machack, on Flickr"><img src="http://farm3.static.flickr.com/2561/3715693644_5f021d6476_m.jpg" width="240" height="105" alt="pitch_est_old" /></a><br />
New algorithm:<br />
<a href="http://www.flickr.com/photos/machack/3715656030/" title="pitch_est by machack, on Flickr"><img src="http://farm3.static.flickr.com/2634/3715656030_167e394f6e_m.jpg" width="240" height="141" alt="pitch_est" /></a><br />
<!--break--><br />
The old algorithm took the signal and ran it through complimentary low and high pass filters, and estimated the pitch as the ratio between the (approximated) power levels of the two. The new one is FFT based with interpolation between adjacent frequency bins. It works pretty well except at the lowest and highest frequency bands. Currently I'm just brute forcing this problem by using enough bins that the lowest one is close enough to DC that I don't care. With 128 bands I only need to run about 84,000 real multiplies per second at my sampling rate, so that should work for now.</p>
    ]]></content>
  </entry>
  <entry>
    <title>HBL LED Driver working</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/66" />
    <id>http://bandgap.rsnsoft.com/drupal/node/66</id>
    <published>2009-06-14T01:03:49-07:00</published>
    <updated>2009-06-14T01:03:49-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>It's officially working! It's kind of hard to see the colors but my camera ran out of battery just after taking this. Each of the 5 LEDs has full RGB color control, 12 bits per channel. The CPU is a 70 MHz ARM7, and the whole thing is an inch square.</p>
<p><object width="425" height="344"></p>
<param name="movie" value="http://www.youtube.com/v/vICV-shf8Ns&amp;hl=en&amp;fs=1&amp;"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vICV-shf8Ns&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
    ]]></summary>
    <content type="html"><![CDATA[<p>It's officially working! It's kind of hard to see the colors but my camera ran out of battery just after taking this. Each of the 5 LEDs has full RGB color control, 12 bits per channel. The CPU is a 70 MHz ARM7, and the whole thing is an inch square.</p>
<p><object width="425" height="344"><br />
<param name="movie" value="http://www.youtube.com/v/vICV-shf8Ns&amp;hl=en&amp;fs=1&amp;"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vICV-shf8Ns&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><!--break-->The old revision was working too but this incorporates some important fixes. The most important fix is that it no longer cooks the LEDs if you turn it on without valid code flashed. The flaw was that I had the BLANK line of the TLC5941 hooked directly to the CPU. The CPU powers up with the GPIOs in high impedence mode. The BLANK line tended toward a low value, enabling the LED outputs, but since GSCLOCK wasn't running the LEDs were either hard on or hard off. The current programming resistor was high enough that hard on was enough to cook the LEDs I had hooked up. Oops.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Random tip: linking 32-bit c++ binaries on 64-bit Ubuntu</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/65" />
    <id>http://bandgap.rsnsoft.com/drupal/node/65</id>
    <published>2009-04-29T11:02:14-07:00</published>
    <updated>2009-04-29T11:02:14-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>Platform: Ubuntu 8.10 (intrepid) 64-bit<br />
Error:<br />
<code>/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.so when searching for -lstdc++<br />
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a when searching for -lstdc++<br />
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.so when searching for -lstdc++<br />
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a when searching for -lstdc++</code><br />
Solution:<br />
<code>apt-get install g++-4.3-multilib</code></p>
    ]]></summary>
    <content type="html"><![CDATA[<p>Platform: Ubuntu 8.10 (intrepid) 64-bit</p>
<p>Error:<br />
<code>/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.so when searching for -lstdc++<br />
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a when searching for -lstdc++<br />
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.so when searching for -lstdc++<br />
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libstdc++.a when searching for -lstdc++</code></p>
<p>Solution:<br />
<code>apt-get install g++-4.3-multilib</code></p>
    ]]></content>
  </entry>
  <entry>
    <title>Random Tip: wine doesn&#039;t like a closed file descriptor on stdin</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/64" />
    <id>http://bandgap.rsnsoft.com/drupal/node/64</id>
    <published>2009-02-24T16:28:06-08:00</published>
    <updated>2009-02-24T16:28:06-08:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p>I wanted to run a <a href="http://www.winehq.org/">wine</a> process in a daemon context, so I closed the stdin file descriptor. On versions 1.0.1 and 1.1.15, at least, this doesn't work.<br />
This fails:<br />
<code>$ ( exec &lt;&amp;- ; wine cmd /c echo hello )<br />
wineserver: chdir to config dir : Not a directory<br />
wine: for some mysterious reason, the wine server failed to run.</code><br />
Use /dev/null instead.<br />
This works:<br />
<code>$ ( exec &lt; /dev/null ; wine cmd /c echo hello )<br />
hello</code></p>
    ]]></summary>
    <content type="html"><![CDATA[<p>I wanted to run a <a href="http://www.winehq.org/">wine</a> process in a daemon context, so I closed the stdin file descriptor. On versions 1.0.1 and 1.1.15, at least, this doesn't work. </p>
<p>This fails:<br />
<code>$ ( exec &lt;&amp;- ; wine cmd /c echo hello )<br />
wineserver: chdir to config dir : Not a directory<br />
wine: for some mysterious reason, the wine server failed to run.</code></p>
<p>Use /dev/null instead.<br />
This works:<br />
<code>$ ( exec &lt; /dev/null ; wine cmd /c echo hello )<br />
hello</code></p>
    ]]></content>
  </entry>
  <entry>
    <title>Useful ARM processor links</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/63" />
    <id>http://bandgap.rsnsoft.com/drupal/node/63</id>
    <published>2009-02-19T14:27:18-08:00</published>
    <updated>2009-02-19T14:27:18-08:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="Other" />
    <summary type="html"><![CDATA[<p>For AVR processors, avrfreaks.net has a pretty good <a href="http://www.avrfreaks.net/index.php?module=Freaks%20Devices&amp;func=devCompare">parametric device search</a>. I had a bit more trouble finding one for ARM processors. Having done so, maybe I can save other folks a little bit of time:<br />
<a href="http://www.keil.com/dd/parms/arm.htm">Parametric List of ARM7/ARM9/Cortex Devices </a><br />
<a href="http://www.keil.com/dd/search_parm.asp">Parametric search</a><br />
Next step: make ARMs as hobbyist-accessible as AVRs.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>For AVR processors, avrfreaks.net has a pretty good <a href="http://www.avrfreaks.net/index.php?module=Freaks%20Devices&amp;func=devCompare">parametric device search</a>. I had a bit more trouble finding one for ARM processors. Having done so, maybe I can save other folks a little bit of time:</p>
<p><a href="http://www.keil.com/dd/parms/arm.htm">Parametric List of ARM7/ARM9/Cortex Devices </a><br />
<a href="http://www.keil.com/dd/search_parm.asp">Parametric search</a></p>
<p>Next step: make ARMs as hobbyist-accessible as AVRs.</p>
    ]]></content>
  </entry>
  <entry>
    <title>LED Boost Controller</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/62" />
    <id>http://bandgap.rsnsoft.com/drupal/node/62</id>
    <published>2008-11-15T23:20:14-08:00</published>
    <updated>2008-11-15T23:27:59-08:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p><a href="http://www.flickr.com/photos/machack/3015541070/" title="LED Boost driver by machack, on Flickr"><img src="http://farm4.static.flickr.com/3224/3015541070_ced110e825_m.jpg" width="240" height="180" alt="LED Boost driver" /></a><a href="http://www.flickr.com/photos/machack/3014705937/" title="LED Boost driver by machack, on Flickr"><img src="http://farm4.static.flickr.com/3201/3014705937_a9e87edcc9_m.jpg" width="240" height="180" alt="LED Boost driver" /></a></p>
<p>The LEDs pictured require at least 8 volts to light in series, but they're being driven by less than 3, through a boost converter. The converter is a TI <a href="http://focus.ti.com/docs/prod/folders/print/tps61161.html">TPS61161</a>, and was surprisingly easy to solder despite its small size and the thermal pad underneath, even with no solder mask and no solder paste. Surface tension really helps here. I just tinned the board using an iron and reflowed using a hot air gun.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p><a href="http://www.flickr.com/photos/machack/3015541070/" title="LED Boost driver by machack, on Flickr"><img src="http://farm4.static.flickr.com/3224/3015541070_ced110e825_m.jpg" width="240" height="180" alt="LED Boost driver" /></a><a href="http://www.flickr.com/photos/machack/3014705937/" title="LED Boost driver by machack, on Flickr"><img src="http://farm4.static.flickr.com/3201/3014705937_a9e87edcc9_m.jpg" width="240" height="180" alt="LED Boost driver" /></a></p>
<p>The LEDs pictured require at least 8 volts to light in series, but they're being driven by less than 3, through a boost converter. The converter is a TI <a href="http://focus.ti.com/docs/prod/folders/print/tps61161.html">TPS61161</a>, and was surprisingly easy to solder despite its small size and the thermal pad underneath, even with no solder mask and no solder paste. Surface tension really helps here. I just tinned the board using an iron and reflowed using a hot air gun.<br />
<!--break--><br />
I made the board using Pulsar's <a href="http://www.pulsarprofx.com/pcbfx/main_site/pages/start_here/_start_here/start_here.html">PCB Fab-in-a-box</a> kit and direct-rub etch technique. Once I followed the correct set of directions it mostly worked, although I need to refine my technique quite a bit. They advertise 6 mil trace/space capability, but I didn't really get success until up to about 10.</p>
<p>The kit starts with a regular toner transfer pass, using a laminator instead of an iron. Then, you make a second pass with a green film that adheres to the toner, but clings much more tenaciously to the copper. The etching is performed by directly rubbing with a rough sponge rather than submerging. Direct agitation and abrasion causes the coper to be removed quite a bit faster than a regular etch tank.</p>
    ]]></content>
  </entry>
  <entry>
    <title>LED Driver, first prototype assembled</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/61" />
    <id>http://bandgap.rsnsoft.com/drupal/node/61</id>
    <published>2008-11-01T22:30:15-07:00</published>
    <updated>2008-11-01T22:30:15-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p><a href="http://www.flickr.com/photos/machack/2994391456/" title="CIMG1082 by machack, on Flickr"><img src="http://farm4.static.flickr.com/3173/2994391456_de318087be_m.jpg" width="240" height="180" alt="CIMG1082" /></a><br />
<a href="http://www.flickr.com/photos/machack/2993549471/" title="CIMG1095 by machack, on Flickr"><img src="http://farm4.static.flickr.com/3162/2993549471_3feccfaae3_m.jpg" width="240" height="237" alt="CIMG1095" /></a></p>
    ]]></summary>
    <content type="html"><![CDATA[<p><a href="http://www.flickr.com/photos/machack/2994391456/" title="CIMG1082 by machack, on Flickr"><img src="http://farm4.static.flickr.com/3173/2994391456_de318087be_m.jpg" width="240" height="180" alt="CIMG1082" /></a><br />
<a href="http://www.flickr.com/photos/machack/2993549471/" title="CIMG1095 by machack, on Flickr"><img src="http://farm4.static.flickr.com/3162/2993549471_3feccfaae3_m.jpg" width="240" height="237" alt="CIMG1095" /></a><br />
<!--break--><br />
I verified the power supply and that the CPU's oscillator is driving the crystal. It'll be a bit longer before I can test the other portions of the system. I used solder paste for the first time when assembling this, which went really well. It made the LQFP 48 and even the QFN 32 packages a breeze. The latter I had expected to be trick or even beyond my capabilities because it doesn't have any pins as such, just pads on the bottom. I just put a bead of solder paste all around the pads on the PCB and used a hot air gun to melt it and it seemed to work fine. I won't know for sure until I have software running on it, of course.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Shameless bragging</title>
    <link rel="alternate" type="text/html" href="http://bandgap.rsnsoft.com/drupal/node/60" />
    <id>http://bandgap.rsnsoft.com/drupal/node/60</id>
    <published>2008-10-30T15:46:35-07:00</published>
    <updated>2008-10-30T18:28:36-07:00</updated>
    <author>
      <name>machack</name>
    </author>
    <category term="MOPTAW" />
    <summary type="html"><![CDATA[<p><a href="/drupal/node/55">The violin</a> project made #1 in Fantasy Magazine's <a href="http://www.darkfantasy.org/fantasy/?p=1057">Top 10 Steampunk Gadgets!</a></p>
    ]]></summary>
    <content type="html"><![CDATA[<p><a href="/drupal/node/55">The violin</a> project made #1 in Fantasy Magazine's <a href="http://www.darkfantasy.org/fantasy/?p=1057">Top 10 Steampunk Gadgets!</a></p>
    ]]></content>
  </entry>
</feed>
