ldfiltbp(3)

LIBRARY ROUTINE
ldfiltbp - designs bandpass filters

LIBRARY CALL
#include "vinclude.h"
int ldfiltbp(poly,f1,f2,f3,f4,tolc,tolr,sfreq,class)
    struct poly_struct *poly;
    int class;
    float f1,f2,f3,f4,tolc,tolr,sfreq;

INPUT

f1  lower digital rejection frequency in hertz.

f2  lower digital cutoff frequency in hertz.

f3  upper digital cutoff frequency in hertz.

f4  upper digital rejection frequency in hertz.

tolc
    cutoff tolerance. specifies the gain at the passband edge. Also determines the magnitude of the ripple for Chebychev I filters.

tolr
    rejection tolerance. specifies the gain at the stopband edge. Also determines the magnitude of the ripple for Chebychev II filters.

sfreq
    sampling frequency of the system.

class
    specifies the filter class to be used. 0 for Butterworth, 1 for Chebychev I, and 2 for Chebychev II.

OUTPUT

poly
    polynomial structure that will contain the filter transfer function at exit.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

Jeremy Worley 09 Mar 1992 19:54 MST
    Added checks of the return values of some internal routines.

DESCRIPTION
dfiltbp is a bandpass filter design function. It is capable of designing Butterworth, Chebychev I, and Chebychev II class filters. A filter designed by this function will be an even order filter consisting of n/2 2nd order stages in a cascade structure, where n is the order of the filter. The filter equation is output in ASCII form as a polynomial function of z.

Each second order stage is of the form:

               a + b*z^-1 + c*z^-2
        S(z) = -------------------
               1 + d*z^-1 + e*z^-2

where a,b, and c are the fiilter stage's numerator coefficients, and d and e are the denominator coefficients. The values of the coefficients are determined by applying a design algorithm based on the filter class.

Butterworth Filters

Butterworth filters are characterized by the property that the magnitude response is maximally flat in the passband. For an nth order filter, the first 2n-1 derivatives of the magnitude squared spectrum are 0 for w = 0. A second characteristic is that the magnitude spectrum is monotonic in both the passband and the stop band. A concavity change occurs at w = wc, the 3dB cutoff frequency.

Chebychev I Filters

Chebychev I class filters are characterized by the property that the magnitude response in the pass band is equiripple, while it is monotonic in the stop band.

Chebychev II Filters

Chebychev II class filters are characterized by the property that the magnitude response in the pass band is monotonic, while in the stop band it is equiripple.

SEE ALSO
dfiltbp(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS

AUTHOR
Jeremy Worley

COPYRIGHT
Copyright 1992, University of New Mexico. All rights reserved.