Atan function

Laurent Berger laurent.berger at univ-lemans.fr
Tue May 10 14:38:44 CEST 2011


In this program

clear;
N=256;
n=0:N-1;
Xr=zeros(1,N);
f0=2;
Xr(f0+1)=1/(2*%i);
Xr(N-(f0+1)+2)=-1/(2*%i);
Xr=Xr.*exp(%i*%pi*2*6*n/N);
xr=ifft(Xr);
disp (atan(imag(Xr(11:12)),real(Xr(11:12))))
disp (Xr(11)-Xr(12))

results are
  0.    3.1415927

     0


I don't understand why two numbers with a difference of 0 can have a 
numerical phase of 0 or pi .
In matlab results are
0 0
0


!Scilab Version:             5.3.1.1299160056 
               !
! 
               !
!Operating System:           Windows XP 5.1 
               !
! 
               !
!Java version :              1.6.0_18 
               !
! 
               !
!Java runtime information :  Java(TM) SE Runtime Environment (build 
1.6.0_18-b07)     !
! 
               !
!Java vm information :       Java HotSpot(TM) Client VM (build 16.0-b13, 
mixed mode)  !
! 
               !
!Vendor specification:       Sun Microsystems Inc. 
               !




More information about the users mailing list