comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Complex rebin
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Complex rebin [message #34534 is a reply to message #34531] Wed, 26 March 2003 18:35 Go to previous messageGo to previous message
MKatz843 is currently offline  MKatz843
Messages: 98
Registered: March 2002
Member
> Any reason why REBIN doesn't take complex args?

I can't say why REBIN doesn't take complex args, but I can say that
you have to be very careful when you interpolate complex values if you
want to have meaningful results.

Consider these two numbers
z1 = complex(1,0) = 1.
z2 = complex(-1,0) = -1.

Suppose you were using rebin to redice the size of a linear array by
2.
Which of the following behaviors would you want?

You could separately average x and y like this, and get zero:
z_avg = (complex(1,0) + complex(-1,0))/2. = complex(0,0) = 0

Or, you could respect the fact that the phase changes by 180 degrees
but the amplitude doesn't change at all. So,

z_avg = complex(0,1) = i

This second value would come from
z1 = r1*exp(i*theta1)
z2 = r2*exp(i*theta2) ;--- note i = complex(0,1)

z_avg = ((r1+r2)/2.) * exp(i * (theta1+theta2)/2.)

To accomplish the first mode, you could break up and separately REBIN
real(a) and imaginary(a).

To accomplish the second mode, you could break up ans separately REBIN
abs(a) and atan(a, /phase)

M. Katz
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 6.0
Next Topic: Is there a standard 'null' array?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 23:03:36 PDT 2025

Total time taken to generate the page: 0.72183 seconds