Read the application note on incremental rotary encoder design considerations
https://www.ti.com/lit/sboa200
This video discusses how either a latch or a linear Hall sensor can be used
for rotary encoding applications. It will walk through important
considerations such as magnet poles, frequency and spacing when designing
such a system.