public unsafe void _Work(Complex *input, float *output, int length) { if (tempLength != length) { temporaryBuffer = DataBuffer.Create(length, sizeof(Complex)); tempPtr = (Complex *)temporaryBuffer; tempLength = length; } VMath.MultiplyByConjugate(ref tempPtr, &input[1], input, length); for (int i = 0; i < length; i++) { output[i] = (float)(Gain * Math.Atan2(tempPtr[i].imag, tempPtr[i].real)); } }