         @a1 =  -2*cosw0
         @a2 =   1 - alpha
 
-      when Filter.BPF_CONSTANT_PEAK       # H(s) = (s/Q) / (s^2 + s/Q + 1)      (constant 0 dB peak gain)
+      when Filter.BAND_PASS_CONSTANT_PEAK       # H(s) = (s/Q) / (s^2 + s/Q + 1)      (constant 0 dB peak gain)
         @b0 =   alpha
         @b1 =   0
         @b2 =  -alpha


  setFilterType: (type) ->
    @type = type
    @recalculateCoefficients()

  setQ: (q) ->
    @parameterType = Filter.Q
    @Q = Math.max(Math.min(q, 115.0), 0.001)
    @recalculateCoefficients()

  setBW: (bw) ->

                      # dB/octave, remains proportional to S for all other values for a
                      # fixed f0/Fs and dBgain.

  #
  # Basic filter parameters
  setCutoffFrequency: (freq) ->
    @setF0(freq)

  setQ: (q) ->
    @parameterType = Filter.Q
    @Q = Math.max(Math.min(q, 115.0), 0.001)
    @recalculateCoefficients()

  #
  # Advanced filter parameters
  coefficients: ->
    b = [@b0, @b1, @b2]
    a = [@a0, @a1, @a2]
