Added lin2complex helper function.