torchsig.utils.dsp.compute_spectrogram¶
- torchsig.utils.dsp.compute_spectrogram(iq_samples: ndarray, fft_size: int, fft_stride: int) ndarray[source]¶
Computes two-dimensional spectrogram values in dB.
- Parameters:
iq_samples (np.ndarray) – Input signal.
fft_size (int) – The size of the FFT in number of bins.
fft_stride (int) – The stride is the amount by which the input sample pointer increases for each FFT. When fft_stride=fft_size, then there is no overlap of input samples in successive FFTs. When fft_stride=fft_size/2, there is 50% overlap of input samples between successive FFTs.
- Raises:
ValueError – Throws an error if fft_stride is less than 0 or greater than fft_size.
- Returns:
Two-dimensional array of spectrogram values in dB.
- Return type:
np.ndarray