NOTCHFILT

Purpose:

Filters a series with a notch comb filter.

Syntax:

NOTCHFILT(s, k, bw, Ab)

s

-

A series, the input series to filter

k

-

An integer, the notch filter order. The order is equal to fs/fo where fs is the sample frequency of input s and fo is the fundamental notch filter frequency. Defaults to 10.

bw

-

A real, the bandwidth of each notch. The bandwidth is equal to (fo/(fs/2))/Q where Q is the Q factor of the filter. Defaults to k * 2 / 35.

Ab

-

An optional real, the dB level for bandwidth bw. Defaults to 10*log10(.5) or -3 dB.

Returns:

The filtered output series.

Example:

L = 10000; fs = 1800; fo = 60; Q = 10;

 

W1: gsin(L, 1/fs, 12) + gsin(L, 1/fs, 60) + gsin(L, 1/fs, 180)

W2: notchfilt(w1, fs/fo, (fo/(fs/2))/Q)

W3: spectrum(w1, 32*1024);semilogx

W4: spectrum(w2, 32*1024);semilogx

 

 

 

 

A notch comb filter is designed with a sample rate of 1800 Hz. The notch frequency is 60 Hz and the Q factor is 10 for a notch bandwidth of 0.00667. The coefficients are returned in direct form.

 

W1 displays the magnitude response of the filter.

 

The filter removes multiples of 60 Hz line noise from the input data.

 

Remarks:

NOTCHCOMB returns the filter coefficients in direct form.

 

The filter order k specifies the number of notch frequencies over the range 0 to fs. The specific notch frequencies are located at F(n) = (n * fs) / k.

 

The transfer function if the notch comb filter is:

 

Notch Transfer Function

 

where the gain is determined so as to normalize the filter output to unity gain.

 

See NOTCHCOMB  to design a direct form notch comb filter.

See Also:

FILTEQ

NOTCHCOMB

 

References:

[1]

Sophocles J. Orfanidis

 

Introduction To Signal Processing

 

Prentice-Hall, 1989