Thanks for the replies.
I want to run a few more experiments before I post the results, however I have taken the suggestions from the posts above and have been experimenting with different low pass filters and code to see what debouncing results I can achieve.
It seems I'm almost there with a combination of a low pass filter, gray code decoding and a hex inverting schmitt-trigger.
As free_electron has pointed out, I am turning the encoder much faster than it was probably designed for.
Looking at other mechanical rotary encoders that are approximately double the price, they have a max of 60rpm. The encoder is being turned by hand, which is connected to an micro-controller that updates a 4-digit 7-segment display. However, when turning it very fast, I noticed that detents were being missed.
I can see that I'm turning the encoder much faster than it's designed to handle and this would not be how it would be turned in everyday use, however if someone were to turn the encoder really fast, skipping pulses is not a desirable thing from a user interface perspective.
Thus, my aim is to see if I can clean-up the bounces and it seems together with gray code decoding, see if I can catch these skipped pulses.
get an optical one...
Yes, an optical encoder would solve the bouncing problem altogether. They seem rather expensive though, from a hobby perspective.
A 100rpm, which is still slower than the 300rpm I posted in the waveform in my first post is approximately $19. A little hefty huh...
Can anyone suggest a relatively cheaper optical encoder?