title: Anyone having an idea how to implement a polyphase filter using c programming
body: <p>Does anyone knows how to implement a polyphase filter using C programming. Polyphase filter is a combination of filtering plus down sampling. It uses an Fir filter for filtering and then down sample it with the given decimation factor.</p>
  
  <p>I understand with filtering it's the convolution of the input signal with the impulse response, so you just have to call the convolution function. </p>
  
  <p>In simple terms the code would be like this.</p>
  
  <pre><code>for ( i = 0; i &lt; sampleCount; i++ ) 
  { 
      y[i] = 0; // set to zero before sum 
      for ( j = 0; j &lt; kernelCount; j++ ) 
      { 
          y[i] += x[i - j] * h[j]; // convolve: multiply and accumulate 
      } 
  }
  </code></pre>
  
  <p>The question I have is how should I convert this basic algorithm to a polyphase filter, because it has one more step as down sampling. I do not understanding what should I do 1st, Filtering and then down sampling? or is there a way to combine both and do it?</p>