I have used 'pspectrum' in MATLAB and I must admit that it is a very powerful function that yields in a very neat power spectrum. Below shows the the power spectrum once plotted using 'pspectrum' and the other using 'fft' method (https://au.mathworks.com/help/signal/ug/power-spectral-density-estimates-using-fft.html). It can be seen that the first plot is much better. My question is: is there a function in python that is equivalent to 'pspectrum'? Thank you

- 13
- 6
1 Answers
U can see the help of matlab,I think it's clearly enough.
https://www.mathworks.com/help/signal/ref/pspectrum.html#mw_9274fcbe-75d0-491e-ac4b-0c8e06543935
If the resolution bandwidth is RBWtheory, then pspectrum computes a single modified periodogram for the whole signal. The function uses a Kaiser window with shape factor controlled by the 'Leakage' name-value pair. See periodogram for more details.
If the resolution bandwidth is RBWperformance, then pspectrum computes a Welch periodogram for the signal.
So,U can use signal.periodogram
when the length of ur signal is short.
When the length of ur signal is long, u need to use signal.welch
,notice u need to calculate nperseg
and noverlap
which is equal to pspectrum
's Segement Length
and Overlap
Hope it's useful for u!

- 209
- 1
- 10