title: Downsampling and applying a lowpass filter to digital audio
body: <p>I've got a 44Khz audio stream from a CD, represented as an array of 16 bit PCM samples.  I'd like to cut it down to an 11KHz stream.  How do I do that?  From my days of engineering class many years ago, I know that the stream won't be able to describe anything over 5500Hz accurately anymore, so I assume I want to cut everything above that out too.  Any ideas?   Thanks.</p>
  
  <p>Update: There is some code on <a href="http://www.codeguru.com/forum/showthread.php?t=463186&amp;page=1&amp;pp=15" rel="noreferrer">this page</a> that converts from 48KHz to 8KHz using a simple algorithm and a coefficient array that looks like { 1, 4, 12, 12, 4, 1 }.  I think that is what I need, but I need it for a factor of 4x rather than 6x.  Any idea how those constants are calculated?  Also, I end up converting the 16 byte samples to floats anyway, so I can do the downsampling with floats rather than shorts, if that helps the quality at all.  </p>