factor spectrogram into its own class