[英]matplotlib power spectral density (PSD) value discrepancy
I tried calculating the power spectral density using matplotlib function psd()
. 我尝试使用matplotlib函数
psd()
计算功率谱密度。 I plotted using two methods: 我使用两种方法绘制:
plt.psd
(red line in plot) plt.psd
进行plt.psd
(图中的红线) psd
to variables and plotting the variables (blue line in plot) psd
的值输出到变量并绘制变量(图中的蓝线) The code I used: 我使用的代码:
power, freqs = plt.psd(P * 100000, len(P), Fs = 1 / dt, scale_by_freq=0)
plt.psd(P * 100000, len(P), 1 / dt, scale_by_freq=0)
plt.plot(freqs, power)
But the plots are different, I expected it to be coincident. 但是情节不同,我希望这是巧合。 From where does the discrepancy arise?
差异从何而来?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.