removed bug loosing parts of the wave depending on frequency