ldfilthp(3)

LIBRARY ROUTINE
ldfilthp - 1D highpass frequency domain filter design

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

INPUT

f1  digital rejection frequency in hertz

fr  digital cutoff frequency (needed for chebychev ii) in hertz

tolc
    magnitude gain at the passband edge. for Chebychev I, it also specifies the magnitude of the ripple.

tolr
    magnitude gain at the stopband edge. for Chebychev II, it also specifies the magnitude of the ripple.

sfreq
    sampling frequency of the system.

class
    filter class: 0 specifies a Butterworth, 1 specifies a Chebychev I, and 2 specifies a Chebychev II.

OUTPUT

poly
    pointer to a poly_struct that contains a description of the polynomial

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
ldfilthp is a high pass 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.

The user specifies cutoff and rejection frequencies as well as epsilon and lambda, two parameters that are related to the cutoff and rejection tolerances by:

        tc = 1/(1+epsilon^2)
        tr = 1/(1+lambda^2)

where tc is the cutoff tolerance, and tr is the rejection tolerance.

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
dfilthp(1), intro(3), vipl(3), verror(3), vutils(3) ldzresp(3), ldfilthp(3)

RESTRICTIONS

AUTHOR
Jeremy Worley, Vena Margo

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