Real-Time Algorithms for Spectral Classification Tasks