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
?