波信号处理(周期)

时间:2012-02-17 07:13:54

标签: algorithm matlab numerical-methods frequency-analysis

检测波形信号中1个周期的最佳方法是什么?

有人有特定的算法吗?你知道你在哪里找到它吗?

我知道fft,但我不知道它是如何让它给我波浪期(时间位置)。

以句点分割信号!

我喜欢pascal,matlab ......

1 个答案:

答案 0 :(得分:1)

这可能不是最好的方式,但可以找到一种方法 周期信号的周期是unwrap the phase。这是Matlab (实际上是Octave)代码:

t = linspace(0, 20, 50);
sig = sin(t) + rand(size(t))*0.2;

% Hilbert transform to give an analytic signal.
% The complex argument will
% now be the instantaneous phase.
n = length(sig);
m = n/2+1;
U = fft(sig) / length(sig);
U((m+1):n) = 0;
cpx = ifft(U);

% Get the phase.
phase = arg(cpx);

% Unwrap the phase.
for i = 2:length(phase)
    k = round((phase(i) - phase(i-1))/(2*pi));
    phase(i) = phase(i) - k*2*pi;
end

% Fit a linear model.
lin_est = [t', repmat(1, length(t), 1)] \ phase';

% The frequency is the rate of change of the phase over time.
freq_est = lin_est(1)/2/pi
T_est = 1 / freq_est

要查看acf的其他内容, fft