IR detection by depletion of trapped charge in localized impurity states of an extrinsic semiconductor