Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!spool.mu.edu!snorkelwacker.mit.edu!stanford.edu!unix!shimizu From: shimizu@unix.SRI.COM (Dan Shimizu) Newsgroups: comp.dsp Subject: phase of complex number Message-ID: <21901@unix.SRI.COM> Date: 5 Mar 91 03:55:04 GMT Reply-To: shimizu@unix.sri.com (Dan Shimizu) Organization: SRI International, Menlo Park, CA Lines: 36 I'm attempting to do an analysis of a multi tone signal using a AT&T DSP32c chip and accompanying algorithims. I'm most interested in the phase relationships between the tones. To accomplish this I'm performing a 64 point real fft and then calulating the phase angle of the bins of interest. The problem: the phase calculation is taking too long. My current (lenghty) solution is: 1) take complex number a + bj 2) perform abs(b/a) (my atan(x) routine only works for x>0) 3) do atan(abs(b/a)) lookup 4) using the signs of the original a and bj, translate atan(abs(b/a)) to the proper quadrant. 5) Done! The most time wasted seems to be in step 4), I must do a multi-level if else construct to find the proper quadrant and perform the appropriate translation, is there an easy way to do this? Someone else suggested that the atan(abs(b/a)) lookup be done as a lookup versus abs(a) and abs(b), so the division would be unecessary. The problem I'm having with this is trying to bound a and b so I can generate the proper table. (Using b/a normalizes the process, so the lookup table does not have to be remade when the magnitude of the inputs to the FFT change). Because this is such a basic problem (finding the phase angle of a complex number), I'm hoping there exits a well-known speedy algorithim to accomplish it....does there? Any questions, mail me or post... Thanks all, DAN Dan Shimizu shimizu@unix.sri.com