Which would be the best arduino sketch for a HRPG-AS16#51C

Hi,
Help and advise wanted please, I am hoping to use a Keysight technologies HRPG-AS16#51C optical rotary sensor in a wind direction vane.

arduino nano v3 being used as processor.

HRPG-as16# 51 :

believed to be a 16 position sensor
smooth running, no detents
channel a = counter clockwise
channel b = clockwise

datasheet attached

I am fairly new to the arduino scene, so any help and advise will be greatly recieved.

regards,
tyntop.

AGLTS05403-1.pdf (194 KB)

1.st stop here: http://playground.arduino.cc/Main/RotaryEncoders