code: function filterCoeffs(f_c) {
    if (f_c > 0.5) {  // we can't lowpass above the nyquist frequency...
      f_c = 0.5;
    }
    var wct = Math.sqrt(2) * Math.PI * f_c;
    var e = Math.exp(-wct);
    var c = e * Math.cos(wct);
    var gain = (1 - 2*c + e*e) / 2;
    return [gain, 2*c, -e*e];
  }
docs: Return 2-pole Butterworth lowpass filter coefficients for center frequncy f_c (relative to sampling frequency)