Tunable optical code converter using XPM and linear-slope pulse stream generated by FBG