Wavelength-tracking high-speed photodetector