Butterworth Filters

#### BUTTERHP, BUTTERLP, BUTTERBP, BUTTERBR

These generators are implementations of second-order hipass, lopass, bandpass, and bandreject butterworth filters. They offer an almost flat passband and very good precision and stopband attenuation. I find the formnt generator produces more musically pleasing results than butterbp, but your mileage may vary.

      make-butterhp frequency
      make-butterlp frequency

      make-butterbp frequency bandwidth
      make-butterbr frequency bandwidth

      butterhp b signal
      butterlp b signal
      butterbp b signal
      butterbr b signal

frequency is the cutoff or center frequency in hertz, and bandwidth is the bandwidth in hertz. Do not set bandwidth > (/ *srate* 2).

The values for frequency and bandwidth can be set within a run loop:

      set-butterhp b frequency
      set-butterlp b frequency

      set-butterbp b frequency bandwidth
      set-butterbp-frequency b frequency
      set-butterbp-bandwidth b bandwidth

      set-butterbr b frequency bandwidth
      set-butterbr-frequency b frequency
      set-butterbr-bandwidth b bandwidth