changed I/O from Matrix to Spectrogram