handling trailing zeros from spectrogram computation