scientimate.periodogrampsd#
f, Sxx = scientimate.periodogrampsd(x, fs=2, WindowName='none', OutputSmoothSize=0, dispout='no')
Description#
Calculate power spectral density using periodogram method
Inputs#
- x
Input data
- fs=2
Sampling frequency that data collected at in (Hz)
- WindowName=’none’
- Window name, define if multiplying input data by window function or not (‘none’: not multiplying)‘none’,’rectangular’,’triangular’,’welch’,’hanning’,’hamming’,’gaussian’,’blackman’,’nuttall’,’blackmanharris’
- OutputSmoothSize=0
- Window size for smoothing calculated spectrum (0, 1 or 2: not smoothing, reports original periodogram)if WindowName=’none’ and OutputSmoothSize>2, then WindowName=’hamming’
- dispout=’no’
Define to display outputs or not (‘yes’: display, ‘no’: not display)
Outputs#
- f
Frequency in (Hz)
- Sxx
Power spectral density using periodogram method (m^2/Hz)
Examples#
import scientimate as sm
import numpy as np
import scipy as sp
from scipy import signal
x=sp.signal.detrend(0.5*np.cos(2*np.pi*0.2*np.arange(0,1024,1/2))+(-0.1+(0.1-(-0.1)))*np.random.rand(1024*2))
f,Sxx=sm.periodogrampsd(x,2,'none',0,'yes')