带有傅立叶变换的信号处理
我需要处理周期性信号并获得其频率。 这可以通过 scipy.fft 轻松完成。
但是,我的特定信号不是严格周期性的。周期略有变化但随机变化。 将 fft 应用于此信号非常困难。获得了许多峰,我不能仅推断我感兴趣的(1/ofere)(1/ofere)的频率范围。
我该怎么做?
这是我正在做的事情的简单代码片段:
df = pd.read_csv('data.txt', header=None)
x = np.asarray(df.iloc[:, 0])
y = np.asarray(df.iloc[:, 1])
yf = fft(y)
xf = fftfreq(len(y))
plt.plot(xf, abs(yf))
您可以在以下github存储库中找到此类信号的示例: https://github.com/crazydecibel/stack-overflow-question
I need to process a periodic signal and obtain its frequency.
This can be easily done with scipy.fft and it works fine.
However, I have a particular signal that is not strictly periodic. The period changes slightly but randomly.
Applying the fft to this signal is quite hard. Many peaks are obtained and I cannot extrapolate only the range of frequencies that are near the (1/period) I am interested in.
How can I do this?
This is a simple code snippet of what I am doing:
df = pd.read_csv('data.txt', header=None)
x = np.asarray(df.iloc[:, 0])
y = np.asarray(df.iloc[:, 1])
yf = fft(y)
xf = fftfreq(len(y))
plt.plot(xf, abs(yf))
You can find an example of such signal at the following GitHub repository, inside the README file: https://github.com/crazydecibel/Stack-Overflow-question
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何使用顶部能源箱的加权平均值?
What about taking the weighted average of frequency of top energy bins?