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
SPMquotcall_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.
SPMquothamm" 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.
SPMquotvsin" with one input and one output vector:
call_udi vsin -I -O < vector.inThis assumes that there is an ASCII file called
SPMquotvector.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
SPMquotcall_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.
SPMquotvdiv" with two input and one output vector:
call_udi vdiv -I -O -fvector2.in < vector1.inThe first vector argument to
SPMquotvdiv" will be read in ASCII format from
SPMquotvector1.in", while the second vector argument will be read from
SPMquotvector2.in" (also in ASCII format). The output will be sent to the standard output in ASCII format.
SPMquotvsadd" which has an input scalar, one input vector and an output vector:
call_udi vsadd -I -O -s5.0 < vector.in
SPMquotbkman" 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.
SPMquotpolar" 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
SPMquotrect", since the vectors represent ordered pairs of data (magnitude, phase) or (x, y).
SPMquotmatinv" 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.
SPMquotmtrans" with an input matrix which is not necessarily square:
call_udi mtrans -I -O -r4 < matrix.inLet's consider that the file
SPMquotmatrix.in" has sixty-four elements. Thus the flag
SPMquot-r4" option tells
SPMquotcall_udi" that the matrix has four rows and sixteen (64/4) columns.
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.