Next: creal() Up: MacAnova Help File Previous: cprdc()   Contents

cprdcj()

Usage:
cprdcj(cx1 [, cx2]), cx1 and cx2 REAL matrices representing complex data



Keywords: time series, complex arithmetic
                                  Usage
cprdcj(cx1, cx2) computes the element wise complex multiplication of
fully complex (pairs of columns constitute real and imaginary parts)
matrices cx1 and cconj(cx2).  When cx1 or cx2 has an odd number of
columns, it is augmented with a column of zeros before multiplication.

cprdcj(cx) is equivalent to cprdcj(cx,cx) and returns as output a matrix
with the squared moduli of the elements of cx, considered as complex
numbers, in the odd columns (real part) of the result, with zero's in
the even columns (imaginary part).

When cx1 or cx2 represents a complex scalar (nrows(cx1) = 1 and
ncols(cx1) <= 2 or nrows(cx2) = 1 and ncols(cx2) <= 2), cprdcj()
multiplies every element of the other argument by that scalar.  For
example,

  Cmd> i_times_cx <- cprdcj(vector(0,1)',cx)

multiplies cconj(cx) by i = sqrt(-1).

When nrows(cx1) = 1 or nrows(cx2) = 1, cprdcj() multiplies each row in
the other argument by that single row.

When cx1 or cx2 represents a single complex series (ncols(cx1) <= 2 or
ncols(cx2) <= 2), cprdcj() multiplies each series in the other argument
by that series.

It is an error when both nrows(cx1) > 1 and nrows(cx2) > 1 and
nrows(cx1) != nrows(cx2), or when both ncols(cx1) > 2 and ncols(cx2) > 2
and ceiling(ncols(cx1)/2) != ceiling(ncols(cx2)/2) (the number of
complex series represented differs).

                                Examples
Examples:
  When ncols(cx1) = 2 and ncols(cx2) = 5, cprdcj(cx1,cx2) is equivalent
  to cprdcj(hconcat(cx1,cx1,cx1),hconcat(cx2,rep(0,nrows(cx2))))

  When a and b are scalars, cprdcj(cmplx(a,b),cx) computes the complex
  scalar product of a + b*i and cconj(cx).

                            Cross references
See also cprdc(), hprdh(), hprdhj(), cdivc(), cdivcj(), hdivh(),
hdivhj(), cconj(), hconcat(), rep(), nrows(), ncols().

See topic 'complex' for discussion of complex matrices in MacAnova.

See subtopic 'matrices:"complex_matrices" for a list of macros for
working with complex matrices.


Gary Oehlert 2005-08-12