Generating a wave with size of the buffer