SignalUtils.NotchFilter Method

procedure NotchFilter(NotchFrequency: Double; r: Double; Num: TVec; Den: TVec; FS: Double);

Design a second-order IIR notch (band-reject) filter.

#NameTypeDescription
1NotchFrequencyDoublescalar
2rDoublescalar
3NumTVecsource TVec
4DenTVecsource TVec
5FSDoublescalar

Result: stored in self (calling object)

Remarks:

Builds the transfer function of a notch that rejects NotchFrequency and stores it in num (numerator) and den (denominator) for use with IirInit / IirFilter. With a = 2pi NotchFrequency/FS the coefficients are

H(z) = (1 - 2cos(a) z^(-1) + z^(-2))/(1 - 2rcos(a) z^(-1) + r^2 z^(-2))

The numerator places a zero exactly on the unit circle at e^(+/- j a) so the gain at the notch frequency is 0; the pole radius r (just inside the unit circle) sets the notch width and depth - r closer to 1 gives a narrower, deeper notch and a longer transient. Domain: 0<r<10 < r < 1 and 0 < NotchFrequency < FS/2; values outside these ranges raise an exception. FS is the sampling frequency (default 2).

See Also: SignalUtils.IirFilter, SignalUtils.DcFilter, SignalUtils.RemoveDC