Spectral analysis refactor