added tests, docs, and bug fixes for spectrogram