title: Why do FFT result show 2 non-zero amplitudes for a samples of single frequency?
body: <p>Doing a simple FFT run to learn the operation, I create an NumPy array with 100 elements having a sine wave with only a single period in the array.  This code is used:</p>
  
  <pre><code>...
  n = 100
  x = np.fromfunction(lambda a: np.sin(2 * np.pi * a / n), (n,), dtype=float)
  res = np.fft.fft(x)
  ...
  </code></pre>
  
  <p>The result in <code>res</code> shows an non-zero amplitude at 2 different index value:</p>
  
  <pre><code>idx           real         imag          abs
  ---     ----------   ----------   ----------
  ...
    1:             0      -50.000       50.000
  ...
   99:             0       50.000       50.000
  </code></pre>
  
  <p>I had only expected to see a single non-zero amplitude at index 1.</p>
  
  <p>Why is amplitude non-zero for both index 1 and 99, and how can I understand this mathematically?</p>
  
  <p>ADDITION: Maybe the high frequency actually represent an <a href="https://en.wikipedia.org/wiki/Aliasing#Sampling_sinusoidal_functions" rel="nofollow noreferrer">aliased</a> frequency, where the sample rate is too low according to the <a href="https://en.wikipedia.org/wiki/Nyquist_rate" rel="nofollow noreferrer">Nyquist rate</a>.</p>