generating sine wave code