Heh, I knew it was a trivial bug! :-) For the record, one should indeed #include <math.h> before using atan2() since the compile will assume int result otherwise, which completely screws the phase calculation. -- CYa, Mario