ldzresp(3)

LIBRARY ROUTINE
ldzresp - Calculates the magnitude, power or phase response of a z-domain system

LIBRARY CALL
#include "vinclude.h"
int ldzresp(image,poly,npolys,numpts,side,resp_type,proc_dir)
    struct xvimage **image;
    struct poly_struct *poly;
    int npolys,numpts,resp_type,side,proc_dir;

INPUT

poly
    polynomials described in terms of struct poly_struct.

npolys
    number of polynomials in poly.

numpts
    number of points per data set.

side
    determines whether response is one-sided (0) or two-sided (1)

resp_type
    a value that specifies what type of response is desired. a value of 0 indicates magnitude; a value of 1 indicates power; and a value of 2 indicates phase.

proc_dir
    process direction: 0 indicated vector oriented processing, 1 indicates band oriented processing.

OUTPUT

image
    pointer to VIFF structure containing image data after processing.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

J. Worley/R. Jordan 20 Nov 1990 15:52
    added side so that -pi/2 - pi/2 or 0 - pi/2 can be generated

Jeremy Worley 27 Nov 1990 00:52 MST
    made modifications to support new internal polynomial structure.

Jeremy Worley 17 Dec 1990 12:58 MST
    support for cases when the evaluation of the polynomial results in infinity.

Jeremy Worley 19 Dec 1990 17:36 MST
    reinitialization bug in the evaluation function was causing an reduction in bandwidth for multi-stage functions.

Jeremy Worley 27 Jan 1992 09:48 MST
    changed declaration of eval_poly() to static int in calling routines.

Jeremy Worley 24 Feb 1992 20:33 MST
    explicitly declared some routines that were previously implicitly declared.

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

DESCRIPTION
dzresp calculates the magnitude, power or phase response of a discrete system in the z transform domain. The input file contains one or more polynomials in standard algebraic form, with extensions for stages. For example:

        H(z) = (100*z^3 + 20*z - 1)/(150*z^2 + 3.14*z + 1);

An example of a multistage polynomial is:

        H(z) = [(2*z^2 + z +1)/(4*z^2 - 1)]*[z^3 + 4];
Each stage may be of any order, and each stage may be of a different order. Dzresp is insensitive to whitespace (tabs, carraige returns, spaces). Each polynomial must be delimited by a semicolon.

When calculating the magnitude or power response, if the result of an evaluation of the transfer function results in infinity, then the result of that evaluation will be set to 1.0e38. If the phase response is being Calculated, and the same thing happens, then the phase at that point will be set to the phase at the next point, unless this is the last point in the data set, in which case it will be set to the value of the previous calculation.

Process direction

Data can be output with either band or vector orientation. The default data processing direction is in the vector direction. This means that data stored in multiband format will be processed as a set pixel location. The direction of processing can be changed so that each band is processed as a signal (instead of each vector being a signal) by setting the proc_dir argument to 1.

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

RESTRICTIONS

AUTHOR
Jeremy Worley

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