Notch Filter

Overview

Notch second-order IIR (Infinite Impulse Response) filter. This filter is embodied by the notch class.

Include

#include <q/fx/biquad.hpp>

Declaration

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

struct notch : biquad
{
         notch(frequency f, float sps, bw _bw);
         notch(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, notch allows these expressions.

Notation

nf

Object of type notch.

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

notch(f, sps [, q])

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

notch(f, sps, bw{b})

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

C++ brace initialization may also be used.

Mutators

Expression Semantics

`nf.config(f, sps [, q])

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

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

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