title: testing ifft implementation in python does not give the good result
body: <p>I am trying to test the np.fft.ifft on a sinus cardinal function, which its Fourier transform is the 'boxcar' function (equal to 1 for |x|&lt;1 and zero elsewhere).</p>
  <p>Here is the code :</p>
  <pre><code>    import numpy as np
      import matplotlib.pyplot as plt
      zetamax = 50.;
      Nzeta = 1024;
      xf = np.linspace(-zetamax, zetamax, Nzeta)
      yf = np.sinc(xf);
      yfft = np.fft.ifft(yf);
      
      #Analytical solution
      Nx = Nzeta/2;
      xmax = Nzeta/(2*zetamax);
      x = np.linspace(-xmax, xmax, Nx);
      
      def boxcar(x):
          if np.abs(x)&lt;1:
              return 1;
          else:
              return 0;
      y = np.zeros(len(x));
      for i in range(len(y)):
          y[i] = boxcar(x[i]);
      
      plt.plot(xf, yf)
      plt.xlabel('zeta')
      plt.ylabel('sinc')
      plt.figure()
      plt.plot(x, yfft[0:Nx], label='IFFT');
      plt.plot(x, y, label='boxcar')
      plt.legend()
      plt.grid()
      
      plt.show()
  </code></pre>
  <p>This is what I get as a result :</p>
  <p><strong>Sinus cardinal:</strong>
  <a href="https://i.stack.imgur.com/fKcdB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fKcdB.png" alt="enter image description here" /></a></p>
  <p><strong>Ifft result versus boxcar function:</strong>
  <a href="https://i.stack.imgur.com/jElHc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jElHc.png" alt="enter image description here" /></a></p>