Creating function that generates noise.