简体   繁体   English

功率谱密度信号

[英]power spectral density-scipy.signal

While trying to compute the Power spectral density with an acquisition rate of 300000hz using ... signal.periodogram(x, fs,nfft=4096) , I get the graph upto 150000Hz and not upto 300000. Why is this upto half the value ? 尝试使用... signal.periodogram(x,fs,nfft = 4096)以300000hz的采集速率计算功率谱密度时,我得到的图形最高为150000Hz而不是最高为300000。为什么这是最高值的一半? What is the meaning of sampling rate here? 这里的采样率是什么意思?

In the example given in scipy documentation , the sampling rate is 10000Hz but we see in the plot only upto 5000Hz. 在scipy文档中给出的示例中,采样率是10000Hz,但是在图中只能看到高达5000Hz的频率。

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.signal.periodogram.html https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.signal.periodogram.html

If you check the length of f in the example: 如果在示例中检查f的长度:

>>> len(f)
>>> 50001

This is NOT 50000 Hz. 这不是50000 Hz。 This is because scipy.signal.periodogram calls scipy.signal.welch with the parameter nperseg=x.shape[-1] by default. 这是因为scipy.signal.periodogram默认情况下使用参数nperseg=x.shape[-1]调用scipy.signal.welch This is the correct input for scipy.signal.welch . 这是scipy.signal.welch的正确输入。 However, if dig into source and see lines 328-329 (as of now), you'll see the reason why the size of output is 50001. 但是,如果深入研究源代码并看到第328-329行(截至目前),您将看到输出大小为50001的原因。

if nfft % 2 == 0:  # even
   outshape[-1] = nfft // 2 + 1

The spectrum of real-valued signal is always symmetric with respect to the Nyquist frequency (half of the sampling rate). 实值信号的频谱始终相对于奈奎斯特频率 (采样率的一半)对称。 As a result, there is often no need to store or plot the redundant symmetric portion of the spectrum. 结果,通常不需要存储或绘制频谱的冗余对称部分。

If you still want to see the whole spectrum, you can set the return_onesided argument to True as follows: 如果仍想查看整个频谱,可以将return_onesided参数设置为True ,如下所示:

f, Pxx_den = signal.periodogram(x, fs, return_onesided=False)

The resulting plot of the same example provided in scipy.periodogram documentation would then cover a 10000Hz frequency range as would be expected: scipy.periodogram文档中提供的相同示例的结果图将覆盖预期的scipy.periodogram频率范围:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具有间隙的信号的功率谱密度? - Power spectral density of a signal with gaps? 正确使用韦尔奇功率谱密度(scipy)的窗口参数? - Proper use of window parameter for Welch power spectral density (scipy)? scipy周期图和自实现功率谱密度之间的差异 - Difference between scipy periodogram and self implemented power spectral density 使用scipy.welch估算时间序列DF的功率谱密度 - Estimate power spectral density of time series DF using scipy.welch 如何找到信号周期(自相关 vs 快速傅立叶变换 vs 功率谱密度)? - How to find period of signal (autocorrelation vs fast fourier transform vs power spectral density)? matplotlib功率谱密度(PSD)值差异 - matplotlib power spectral density (PSD) value discrepancy 计算白噪声的功率谱密度时出现无法解释的对称性 - Unexplained symmetry when computing Power Spectral Density of white noise python中离散功率谱密度的正确归一化实际问题 - Correct normalization of discrete power spectral density in python for a real problem 如何使用USRP数据计算功率谱密度? - How to Calculate power spectral density using USRP data? 在绘制给定数据集的功率谱密度时需要abs()方法 - Need of abs () method while plotting a power spectral density for a given dataset
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM