Digital Residual Spectrum-Based Generalized Soft Failure Detection and Identification in Optical Networks