快速平均平方差函数

发布于 2024-07-24 15:34:18 字数 480 浏览 4 评论 0原文

我想知道是否有人知道计算周期信号的平均平方差函数(ASDF)或平均幅度差函数(AMDF)的快速(即 O(N log(N)) )方法,或者甚至是可能的。

我知道可以使用FFT来计算周期性互相关。 例如,在Matlab代码中,

for i=1:N
xc(i)=sum(x1*circshift(x2,i-1));
end

相当于更快

xc=ifft(fft(x1).*conj(fft(x2));

是否有类似的“快速”算法

for i=1:N
ASDF(i)=sum((x1-circshift(x2,i-1)).^2)/N;
end

for i=1:N
AMDF(i)=sum(abs(x1-circshift(x2,i-1)))/N;
end

I'm wondering if anyone knows of a fast (i.e. O(N log(N)) ) method of calculating the average square difference function (ASDF) or average magnitude difference function (AMDF) for a periodic signal, or it is even possible.

I know that one can use the FFT to calculate the periodic cross correlation. For example, in Matlab code,

for i=1:N
xc(i)=sum(x1*circshift(x2,i-1));
end

is equivalent to the much faster

xc=ifft(fft(x1).*conj(fft(x2));

Is there a similar "fast" algorithm for

for i=1:N
ASDF(i)=sum((x1-circshift(x2,i-1)).^2)/N;
end

or

for i=1:N
AMDF(i)=sum(abs(x1-circshift(x2,i-1)))/N;
end

?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丑疤怪 2024-07-31 15:34:18

方式扩展 ASDF 的定义:

for i = 1:N
    asdf(i) = (sum(x1.^2) - 2*sum(x1*circshift(x2,i-1)) + sum(x2.^2))/N;
end

您可以按如下

asdf = (-2*ifft(fft(x1).*conj(fft(x2))) + sum(x1.^2) + sum(x2.^2))/N;

You can expand your definition of ASDF as follows:

for i = 1:N
    asdf(i) = (sum(x1.^2) - 2*sum(x1*circshift(x2,i-1)) + sum(x2.^2))/N;
end

which simplifies to

asdf = (-2*ifft(fft(x1).*conj(fft(x2))) + sum(x1.^2) + sum(x2.^2))/N;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文