Test for negative, nan, and inf values in spectrum