In position control of mechatronic devices, velocity feedback is necessary for injecting additional damping to avoid low-frequency fluctuation around desired trajectories. In practice, velocity signal is often obtained by performing Euler discretization on position signal from an optical encoder. However, due to the limited encoder resolution, the obtained velocity signal is corrupted by high-frequency noise that may result in high-frequency vibration of the controlled device. This paper presents a discrete-time velocity estimator based on sliding mode and adaptive windowing for position control. Experimental results show that the presented estimator rather improves velocity feedback compared to a sliding mode filter by Jin et al. (2012), an adaptive windowing filter by Janabi-Sharifi et al. (2000), and the cascades of these two filters.