Refactored half-complex dft.
Added array preallocation logic.