Extract sine wave encoding to separate function