Stable morse encoder and decoder