Band Pass Filter; Constant Peak Gain

Overview

Band pass second-order IIR (Infinite Impulse Response) filter with constant 0 dB peak gain. This filter is embodied by the allpass class.

Include

#include <q/fx/biquad.hpp>

Declaration

struct bw (1)
{
   double val; // in octaves
};

struct bandpass_cpg : biquad
{
         bandpass_cpg(frequency f, float sps, bw _bw);
         bandpass_cpg(frequency f, float sps, double q = 0.707);

   void  config(frequency f, float sps, bw _bw);
   void  config(frequency f, float sps, double q = 0.707);
};
1 Utility type to distinguish bandwidth from q which is just a double

Expressions

In addition to valid expressions for biquad, bandpass_cpg allows these expressions.

Notation

bf

Object of type bandpass_cpg.

f

Object of type frequency.

sps

Floating point value representing samples per second.

b

Bandwidth (in octaves).

q

Q or quality factor.

a [, b, c, d]

Required a, optional b, c, d.

Constructor

Expression Semantics

bandpass_cpg(f, sps [, q])

Construct a bandpass_cpg filter from f, sps and optional q (defaults to 0.707).

bandpass_cpg(f, sps, bw{b})

Construct a bandpass_cpg filter from f, sps and b (bandwidth).

C++ brace initialization may also be used.

Mutators

Expression Semantics

bf.config(f, sps)

Configure a bandpass_cpg filter from f, sps. q defaults to 0.707

bf.config(f, sps [, q])

Configure a bandpass_cpg filter from f, sps and optional q (defaults to 0.707).

bf.config(f, sps, bw{b})

Configure a bandpass_cpg filter from f, sps and b (bandwidth).