Spectral methods for neural characterization using generalized quadratic models