Simplified and improved GenerateNoise function to get rid of the "kinks" caused by improper wrapping