- 3.2.1 Output Vector
- 3.2.2 Input Vector and Output Vector
- 3.2.3 Two Input Vectors and Output Vector
- 3.2.4 Input Vector, Input Scalar, Output Vector
- 3.2.5 Input Flag, Output Vector
- 3.2.6 Input Vector with Increment, Output Vector
- 3.2.7 Square Input Matrix, Input Scalar and Output Matrix
- 3.2.8 Input Matrix and Output Matrix
- 3.2.9 Two Input Matrices and Output Matrix

Since there are several ways in which arguments are passed to the **UDI** DSP
functions, some examples might be helpful. These examples don't cover every
possible combination of input/output vectors, input/output scalars, and flags,
but they should be sufficient to give the `SPMquot`

call_udi" user a good idea
of how to call any of the functions. Please see the chapter describing
the DSP functions in order to see how arguments are passed to each specific
function. Since some of these command lines are a bit complicated with
several options, it may be worthwhile for the user to create aliases or
shell scripts to reduce the amount of typing for commonly used calls.

`SPMquot`

hamm" with no input, but one vector output:
call_udi hamm -d16 -ONote that the

`SPMquot`

-d" option is required to specify the length of the
desired output vector. The `SPMquot`

-O" option causes the output to be in
ASCII form instead of binary.

`SPMquot`

vsin" with one input and one output vector:
call_udi vsin -I -O < vector.inThis assumes that there is an ASCII file called

`SPMquot`

vector.in", with one
floating-point number per line. Note that it isn't necessary to specify the
length of the input vector with the `SPMquot`

-d" option, since `SPMquot`

call_udi"
counts the number of lines in the input file. Be careful though! If instead
of redirecting input from a file, you use the console to directly type the
input, or if you use a pipe, it would then be necessary to specify the length
explicitly. The output will be sent to the standard output also in ASCII format.

`SPMquot`

vdiv" with two input and one output vector:
call_udi vdiv -I -O -fvector2.in < vector1.inThe first vector argument to

`SPMquot`

vdiv" will be read in ASCII format from
`SPMquot`

vector1.in", while the second vector argument will be read from
`SPMquot`

vector2.in" (also in ASCII format). The output will be sent to the
standard output in ASCII format.

`SPMquot`

vsadd" which has an input scalar, one
input vector and an output vector:
call_udi vsadd -I -O -s5.0 < vector.in

`SPMquot`

bkman" which has a flag input, and
an output vector:
call_udi bkman -d16 -O -y2Here, the

`SPMquot`

-y2" flag specifies the coefficients to use in computing
the Blackman window. Again it's necessary to use the `SPMquot`

-d" option
to specify the length of the output vector, since there's no input vector.

`SPMquot`

polar" which uses an increment, and
has an input and output vector:
call_udi polar -I -O -c2 < vector.in > vector.outNotice that it's necessary to use a multiple of two for the input increment with functions such as

`SPMquot`

polar" and `SPMquot`

rect", since the vectors
represent ordered pairs of data (magnitude, phase) or (x, y).

`SPMquot`

matinv" assuming that the input and
output matrices are square (number of elements in the file is a power of two):
call_udi matinv -I -O -s0.0 < matrix.in Notice that it isn't necessary to use the \verb"-r" option since the number of rows, by default, is the square root of the number of elements in the file.

`SPMquot`

mtrans" with an input matrix which is not
necessarily square:
call_udi mtrans -I -O -r4 < matrix.inLet's consider that the file

`SPMquot`

matrix.in" has sixty-four elements.
Thus the flag `SPMquot`

-r4" option tells `SPMquot`

call_udi" that the matrix has
four rows and sixteen (64/4) columns.

`SPMquot`

mmul" or `SPMquot`

vmmul":
call_udi mmul -I -O -r4 -fmatrix2.in < matrix1.inHere the dimensions of both input matrices may be arbitrary, except the number of rows of the second matrix must equal the number of columns in the first matrix. The

`SPMquot`

-r4" option specifies the number of rows
for the first matrix. The other dimensions are calculated by considering
the number of elements in both files.