Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //buffer (IntPtr) contains the PCM data in 32-bit floating point samples
- //length (int) is the number of bytes to process
- Complex[] cOutput = new Complex[length/4]; //allocate the buffer to store the complex numbers
- float* data = (float*)buffer;
- for (int i = 0; i < (length / 4); i++)
- {
- cOutput[i] = new Complex((double)data[i], 0.0); //fill the Complex array
- }
- Fourier.Forward(cOutput); //apply the FFT to the filled Complex array and overwrite its data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement