obspy.signal.spectral_estimation.psd¶
- psd(x, NFFT=256, Fs=2, detrend=<function detrend_none at 0xa240bfc>, window=<function window_hanning at 0xa240ae4>, noverlap=0)[source]¶
Wrapper for matplotlib.mlab.psd().
Always returns a onesided psd (positive frequencies only), corrects for this fact by scaling with a factor of 2. Also, always normalizes to dB/Hz by dividing with sampling rate.
This wrapper is intended to intercept changes in matplotlib.mlab.psd() default behavior which changes with matplotlib version 0.98.4:
- http://matplotlib.org/users/whats_new.html#psd-amplitude-scaling
- http://matplotlib.org/_static/CHANGELOG (entries on 2009-05-18 and 2008-11-11)
- http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=revision&revision=6518
- http://matplotlib.org/api/api_changes.html#changes-for-0-98-x
Note
For details on all arguments see matplotlib.mlab.psd().
Note
When using window=welch_taper (obspy.signal.spectral_estimation.welch_taper()) and detrend=detrend_linear (matplotlib.mlab.detrend_linear()) the psd function delivers practically the same results as PITSA. Only DC and the first 3-4 lowest non-DC frequencies deviate very slightly. In contrast to PITSA, this routine also returns the psd value at the Nyquist frequency and therefore is one frequency sample longer.