<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#330000">
    it looks like a bug, which could be linked to the fact that even if
    Xr(11:12)==[0 0], Xr(11:12) are complex number for scilab (try
    isreal(Xr(11:12))).<br>
    <br>
    are you trying to get the phase of thoses complex numbers?<br>
    if yes, i suggest you to use something like
    imag(log(Xr(11:12)+%eps)) as a crapy workaround (instead of
    atan(imag(xr),real(xr)))<br>
    <br>
    <br>
    <br>
    Le 10/05/2011 14:38, Laurent Berger a écrit :
    <blockquote cite="mid:4DC931D4.5090902@univ-lemans.fr" type="cite">In
      this program
      <br>
      <br>
      clear;
      <br>
      N=256;
      <br>
      n=0:N-1;
      <br>
      Xr=zeros(1,N);
      <br>
      f0=2;
      <br>
      Xr(f0+1)=1/(2*%i);
      <br>
      Xr(N-(f0+1)+2)=-1/(2*%i);
      <br>
      Xr=Xr.*exp(%i*%pi*2*6*n/N);
      <br>
      xr=ifft(Xr);
      <br>
      disp (atan(imag(Xr(11:12)),real(Xr(11:12))))
      <br>
      disp (Xr(11)-Xr(12))
      <br>
      <br>
      results are
      <br>
       0.    3.1415927
      <br>
      <br>
          0
      <br>
      <br>
      <br>
      I don't understand why two numbers with a difference of 0 can have
      a numerical phase of 0 or pi .
      <br>
      In matlab results are
      <br>
      0 0
      <br>
      0
      <br>
      <br>
      <br>
      !Scilab Version:             5.3.1.1299160056               !
      <br>
      !               !
      <br>
      !Operating System:           Windows XP 5.1               !
      <br>
      !               !
      <br>
      !Java version :              1.6.0_18               !
      <br>
      !               !
      <br>
      !Java runtime information :  Java(TM) SE Runtime Environment
      (build 1.6.0_18-b07)     !
      <br>
      !               !
      <br>
      !Java vm information :       Java HotSpot(TM) Client VM (build
      16.0-b13, mixed mode)  !
      <br>
      !               !
      <br>
      !Vendor specification:       Sun Microsystems Inc.               !
      <br>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <style>
<!--
  p
        {margin:0pt;
           color:teal;
           font-family:"Cambria Math"
        font-size:12.0pt;
        }
-->
</style>
      <p><b>Adrien Vogt-Schilb</b></p>
      <p>Research Fellow</p>
      <p><a a="" href="mailto:vogt@centre-cired.fr"
          style="text-decoration: none; color: teal;">vogt@centre-cired.fr</a></p>
      <p>Tel: (+33) 1 43 94 73 96</p>
      <p>Fax: (+33) 1 43 94 73 70</p>
      <table style="border: medium none; margin-left: 1pt; margin-top:
        4pt;" cellspacing="0">
        <tbody>
          <tr>
            <td style="padding: 0pt;">
              <p><img src="cid:part1.03060808.03030403@centre-cired.fr"
                  alt="CIRED" width="54"></p>
            </td>
            <td style="padding: 0pt 7pt;" valign="middle">
              <p style="font-size: 10pt;">45 bis, Av de la Belle
                Gabrielle</p>
              <p style="font-size: 10pt;">F-94736 Nogent-sur-Marne</p>
              <p style="font-size: 10pt;"><a
                  href="http://www.centre-cired.fr/" style="color:
                  teal;">http://www.centre-cired.fr/</a></p>
            </td>
          </tr>
        </tbody>
      </table>
      <p> </p>
    </div>
  </body>
</html>