Given a 40 Hz non-stationary signal, with a total of 4800 samples, I want to generate a spectrogram with appropriate parameters, and I was wondering how best to set the parameters in scipy.signal.spectrogram
to use a window of 5 seconds and a 2.5 second overlap.
Would the following be correct?
f, t, Sxx = signal.spectrogram(trace.data, fs=40, nperseg=200, window=('hamming'), noverlap=100)
I get slightly confused if I use a different windowing technique, i.e. slepian
, which requires a width. What is the difference between this width used with the slepian
window, and the nperseg
parameter? Also, what would be the benefit of applying zero-padding (nfft
)?
Thanks.