在波信号中检测 1 个周期的最佳方法是什么?
有人有特定的算法来做到这一点吗?你知道你在哪里找到的吗?
我知道fft,但我不知道如何让它给我波浪周期(时间位置)。
分割信号周期!
我想要pascal,matlab ...
在波信号中检测 1 个周期的最佳方法是什么?
有人有特定的算法来做到这一点吗?你知道你在哪里找到的吗?
我知道fft,但我不知道如何让它给我波浪周期(时间位置)。
分割信号周期!
我想要pascal,matlab ...
这可能根本不是最好的方法,但是可以找到周期信号周期的一种方法是展开 相位。这是 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