SHARE
TWEET

Untitled

a guest Aug 20th, 2017 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //buffer (IntPtr) contains the PCM data in 32-bit floating point samples
  2.         //length (int) is the number of bytes to process
  3.  
  4.         Complex[] cOutput = new Complex[length/4]; //allocate the buffer to store the complex numbers
  5.         float* data = (float*)buffer;
  6.         for (int i = 0; i < (length / 4); i++)
  7.         {
  8.             cOutput[i] = new Complex((double)data[i], 0.0); //fill the Complex array
  9.         }
  10.  
  11.         Fourier.Forward(cOutput); //apply the FFT to the filled Complex array and overwrite its data
RAW Paste Data
Top