linearized scalar encoder

Combine these two lines