finddelay returns identical value (0) for "best" and "worst" case.

조회 수: 3 (최근 30일)
Evan
Evan 2015년 8월 19일
댓글: Evan 2015년 8월 21일
I'm curious about what the reasoning could be for having finddelay() return 0 if no significant correlation is found. That means that the user has no way of distinguishing cases where the signals overlap with 0 delay and when the signals are not correlated at all. Why not return NaN?

답변 (1개)

Brian Neiswander
Brian Neiswander 2015년 8월 21일
Hi Evan,
The "finddelay" function does not consider the strength of the correlation found. Given two signals, it simply returns the lag that produces the maximum absolute value of their cross-correlation. In the "More About" section of the "finddelay" documentation page below:
you can find a description of the algorithm used to calculate the estimated delay. Here, it states that:
"Pairs of signals need not be exact delayed copies of each other. However, the estimated delay has a useful meaning only if there is sufficient correlation between at least one pair of the delayed signals."
In other words, the output will not be significant if the two signals are uncorrelated. For the functionality you are asking for, you can use the code suggested by Wayne King in the following MATLAB Answers post:
Hope this is helpful.
-Brian
  댓글 수: 1
Evan
Evan 2015년 8월 21일
Are you sure? Here is the code I'm referring to, from finddelay() in R2015a:
% Set to zeros estimated delays for which the normalized cross-correlation
% values are below a given threshold (spurious peaks due to FFT roundoff
% errors).
for i=1:length(d)
if max_c(i)<1e-8
d(i) = 0;
if isscalar(d) && maxlag(i)~=0
warning(message('comm:finddelay:noSignificantCorrelationScalar'));
elseif isvector(d) && maxlag(i)~=0
warning(message('comm:finddelay:noSignificantCorrelationVector', i));
end
end
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by