title: get the result from array of discrete forurier transform
body: <p>I just wrote the implementation of dft. Here is my code:</p>
  
  <pre><code>        int T = 2205;
  
          float[] sign = new float[T]; 
          for (int i = 0, j = 0; i &lt; T; i++, j++)
              sign[i] = (float)Math.Sin(2.0f * Math.PI * 120.0f * i/ 44100.0f);
  
          float[] re = new float[T];
          float[] im = new float[T];
          float[] dft = new float[T];
  
          for (int k = 0; k &lt; T; k++)
          {
              for (int n = 0; n &lt; T; n++)
              {
                  re[k] += sign[n] * (float)Math.Cos(2.0f* Math.PI * k * n / T);
                  im[k] += sign[n] * (float)Math.Sin(2.0f* Math.PI * k * n / T);;
              }
              dft[k] = (float)Math.Sqrt(re[k] * re[k] + im[k] * im[k]);
          }
  </code></pre>
  
  <p>So the sampling freguency is 44100 Hz and I have a 50ms segment of a 120Hz sinus wave. According to the result I have a peak of the dft function at pont 7 and 2200. Did I do something wrong and if not, how should I interpret the results?</p>
  
  <hr>
  
  <p>I tried the FFT method of AFORGE. Heres is my code.</p>
  
  <pre><code>      int T = 2048;
  
          float[] sign = new float[T];
          AForge.Math.Complex[] input = new AForge.Math.Complex[T];
          for (int i = 0; i &lt; T; i++)
          {
              sign[i] = (float)Math.Sin(2.0f * Math.PI * 125.0f * i / 44100.0f);
              input[i].Re = sign[i];
              input[i].Im = 0.0;
          }
  
          AForge.Math.FourierTransform.FFT(input, AForge.Math.FourierTransform.Direction.Forward);
          AForge.Math.FourierTransform.FFT(input, AForge.Math.FourierTransform.Direction.Backward);
  </code></pre>
  
  <p>I had expected to get the original sign but I got something different (a function with only positive values). Is that normal?
  Thanks in advance!</p>