ldgpwl(3)

LIBRARY ROUTINE
ldgpwl - Generates a set of piecewise linear periodic signals.

LIBRARY CALL
#include "vinclude.h"
int ldgpwl(image,numvec,numpts,fs,minimum,maximum,period,rise,fall,
           width,delay,type,procdir)
    struct xvimage **image;
    int    numvec,numpts,procdir,type,delay;
    float  fs,minimum,maximum,period,rise,fall,width;

INPUT

image
    as an optional input, this argument can be used to pass the pointer to the parameter "kernel", if this argument is NULL, then the parameter option is not used.

numvec
    number of data vectors

numpts
    number of points per data vector

fs  sampling frequency

minimum
    minimum value of function

maximum
    maximum value of function

period
    period of the function in seconds

rise
    rise time in seconds

fall
    fall time in seconds

width
    width of pulse

delay
    initial delay in number of data points

type
    data type of output image. This must be either VFF_TYP_FLOAT or VFF_TYP_COMPLEX.

procdir
    process direction. This can be either 0 for vector processing or 1 for band processing.

OUTPUT

image
    holds the result of the data generation. The output data type is the same as the input data type.

return Value:
    1 on success, 0 on failure.

MODIFICATIONS

Jeremy Worley 05 Mar 1992 11:10 MST
    Fixed a call to fprintf that too few arguments in ldgpwl(). Added an explicit declaration to genpwl() in ldgpwl(). Added an explicit declaration to gpwl() in genwpl().

DESCRIPTION
creates a one dimensional set of signals. The image pixel values follow a square waveform. The user can specify the period, phase, minima and maxima, sampling frequency, rise and fall times, an initial delay, and signal dimensions.
If a "value file" is specified, it will contain a kernel that describes the signal ensemble to be generated. This is an viff format file. The information will be contained in a single vector of float type information. The row and column size information is irrelevant. The format of the information is as follows:
[<sampling freq.><minimum><maximum><period><rise><fall><width><init. delay>]
where each item enclosed in triangular brackets represents a single float. The information set in square brackets is repeated as a group one per vector.
For example if 2 vectors are specified, and the first vector has a sampling frequency of 10.0, an minimum of 6.0, a maximum of 10.0, period of 2.0, rise of 0.0, fall of 1.0, width of 13.0, initial delay of 0.0, initial delay of 0; the second vector is identical, except that the minimum is 3.0 and the initial delay is 7, then the image data in the "parameter file" will look like this:
band #1: 10.0 10.0
band #2: 6.0 3.0
band #3: 10.0 10.0
band #4: 2.0 2.0
band #5: 0.0 0.0
band #6: 1.0 1.0
band #7: 13.0 13.0
band #8: 0.0 7.0
The advantage of this "parameter file" is that it allows the creation of an ensemble of 1D signals that independant of each other. Number of data sets, number of points per data set, data type, and process direction must be entered on the command line, or the defaults can be taken. If more data sets are requested than are specified in the parameter file, then an error will occur. If fewer data sets are requested than are specified, then the unused parameters will be ignored.
A non zero initial delay causes the number of points indicated to be zeroed. After the indicated delay, the sinusoidal signal is generated with a time shift equivalent to the delay specified (i.e. the t=0 line is shifted to the right based on the value of the delay).
NOTE: According to the Sampling Theorem, the sampling frequency should be at least twice that of the signal frequency to generate a signal properly.
The resulting images may be of type FLOAT or COMPLEX.
Data can be processed 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 of data sequences, where each sequence corresponds to a pixel location, and the points of each sequence are defined by the bands corresponding to that 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 -d option to 1.

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

RESTRICTIONS
can only generate VFF_TYP_FLOAT and VFF_TYP_COMPLEX type images.

AUTHOR
Jeremy Worley

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