Improved test function, also now testing zero phase input.