使用Octave估算数据周期的最快方法是什么? [英] What's the fastest way to approximate the period of data using Octave?
问题描述
我有一组周期性的数据(但不是正弦曲线的).我在一个向量中有一组时间值,在第二个向量中有一组振幅.我想快速估算一下功能的周期.有什么建议吗?
I have a set of data that is periodic (but not sinusoidal). I have a set of time values in one vector and a set of amplitudes in a second vector. I'd like to quickly approximate the period of the function. Any suggestions?
具体地说,这是我当前的代码.我想针对向量t估算向量x(:,2)的周期.最终,我想在很多初始条件下执行此操作,并计算每个条件的周期并绘制结果.
Specifically, here's my current code. I'd like to approximate the period of the vector x(:,2) against the vector t. Ultimately, I'd like to do this for lots of initial conditions and calculate the period of each and plot the result.
function xdot = f (x,t)
xdot(1) =x(2);
xdot(2) =-sin(x(1));
endfunction
x0=[1;1.75]; #eventually, I'd like to try lots of values for x0(2)
t = linspace (0, 50, 200);
x = lsode ("f", x0, t)
plot(x(:,1),x(:,2));
谢谢!
约翰
推荐答案
看看自动关联功能.
来自维基百科
自相关是 信号与 本身.非正式地,它是 观察之间的相似性 时间分离的功能 它们之间.这是数学上的 查找重复模式的工具, 例如周期性的存在 被掩埋的信号 噪音,或找出失踪者 信号中的基频 由它的谐波频率暗示. 常用于信号处理 用于分析功能或一系列 值,例如时域信号.
Autocorrelation is the cross-correlation of a signal with itself. Informally, it is the similarity between observations as a function of the time separation between them. It is a mathematical tool for finding repeating patterns, such as the presence of a periodic signal which has been buried under noise, or identifying the missing fundamental frequency in a signal implied by its harmonic frequencies. It is often used in signal processing for analyzing functions or series of values, such as time domain signals.
Paul Bourke对如何基于快速傅立叶变换有效地计算自相关函数进行了描述(链接).
Paul Bourke has a description of how to calculate the autocorrelation function effectively based on the fast fourier transform (link).
这篇关于使用Octave估算数据周期的最快方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!