Home > eeg > egis > ppc_utils > ppc_cmplx_mult.m

ppc_cmplx_mult

PURPOSE ^

function z = ppc_cmplx_mult(x,y)

SYNOPSIS ^

function z = ppc_cmplx_mult(x,y)

DESCRIPTION ^

 function z = ppc_cmplx_mult(x,y)

 multiplies two complex valued vectors by breaking up
 the multiplication into multiple steps to avoid rounding
 errors that will return erroneous results if a number is multiplied
 by its complex conjugate on the PowerMac

 Use this function if you want a complex vector multiplied by its conjugate
 to return a real-valued vector.

 Tech-support at Mathworks suggested this fix.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function z = ppc_cmplx_mult(x,y)
0002 % function z = ppc_cmplx_mult(x,y)
0003 %
0004 % multiplies two complex valued vectors by breaking up
0005 % the multiplication into multiple steps to avoid rounding
0006 % errors that will return erroneous results if a number is multiplied
0007 % by its complex conjugate on the PowerMac
0008 %
0009 % Use this function if you want a complex vector multiplied by its conjugate
0010 % to return a real-valued vector.
0011 %
0012 % Tech-support at Mathworks suggested this fix.
0013 
0014 % Written by Petr Janata, Jan. 17, 1996.
0015 
0016 z = real(x).*real(y) + real(x).*imag(y) + real(y).*imag(x) - imag(x).*imag(y);
0017 
0018 return

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003