1

I've recently come across this formula from an ITU-T standard in a project that I'm working on.

The application of the formula is to compare two vectors containing some per frame statistics from two very similar video signals, and try to find any evidence of a delay of $n$ frames between them, i.e. that the vectors contain similar values at an offset of $n$ positions.

The define the measure like this:

Let $X[t]$ and $Y[t]$ be two vectors with the length $nx$ and $ny$. Then, a normalized product-moment correlation is given by: $$ \widetilde{r}_{xy}[n] = \dfrac{1}{\sqrt{\sum_{t=0}^{nx-1}(X[t]-\overline\chi) \sum_{t=0}^{nx-1}(Y[t]-\overline\xi)}}\sum_{t=-nx}^{nx}(X[t]-\overline\chi)(Y[t+n]-\overline\xi) $$ with $$ \overline\chi = \dfrac{1}{xStop-xStart+1}\sum_{t=xStart}^{xStop}X[t] $$ and $$ \overline\xi = \dfrac{1}{yStop-yStart+1}\sum_{t=yStart}^{yStop}Y[t] $$ where $\{xy\}Start$ is the index of the first and $\{xy\}Stop$ the index of the last non-zero value within the vector.

The second summation that ranges $t \in [-nx, nx]$ appears strange to me - how can I index $X[t]$ with negative values for $t$ from the first half of the range? Similarly, depending on the value of $n$, the index $t+n$ may easily fall outside the valid range of $Y[t]$.

I can't figure out what the authors' intentions are here. Does anyone understand how to deal with this out of range indexing and still getting a useful result? Does it make sense to substiute all out of range values with $0$, and how would that affect the result?

Note: The resulting vector (I presume) is to contain a measure of how well the vector correlate offset $n$ spaces - we try a range of different $n$-s and see which one is best, i.e. yields the highest value. Also, in my context, $nx$ and $ny$ are always equal.


EDIT I'll add that the authors' use of this is the following

An estimate of the delay between the vectors is given by: $$delay(X[t],Y[T])=\mathop{\text{argmax}}_n(\widetilde{r}_{xy}[n])$$ The value $$corrm(X[t],Y[T])=\mathop{\text{max}}_n(\widetilde{r}_{xy}[n])$$ is the similarity measure and represents an estimate of the accuracy of the estimated delay.

Henrik
  • 111
  • 3
  • 2
    (+1) This abominable notation is getting in the way of your understanding and impedes the author's ability to detect and correct errors. (For similar formulas--correctly and more simply rendered--see the answers at http://stats.stackexchange.com/questions/81754, for instance.) I notice also that the authors attempt to index the vectors from $0$ through $n_x-1$ in the denominator but up to $n_x$ in the numerator. Providing a text description of what this abortive formula is attempting to convey would help people decipher its intended meaning. – whuber Aug 22 '14 at 16:04
  • @whuber Absolutely, the notation is abysmal. I noticed the difference in limiting at $nx$ and $nx-1$ as well. My guess is, seeing that we're working on pretty large vectors, it most likely doesn't matter much. It's definitely a marker for sloppiness anyway. – Henrik Aug 22 '14 at 16:16
  • Thank you for including the text description. Unfortunately it does not resolve the issue. That description basically says to find the lag at which the cross-correlation is maximized, as described at http://stats.stackexchange.com/questions/31666, http://stats.stackexchange.com/questions/14351, and elsewhere on this site. It does not explain why $x_{start}$, ..., $y_{stop}$ are used instead of the full dimensions of each vector. Perhaps the authors use zero as an indicator of no data at all (and then forget that fact in their formulas)? – whuber Aug 22 '14 at 17:47
  • @whuber The vectors may be zero padded to have equal length, that seems to be why they use $xStart,\ldots,xStop$ – Henrik Aug 25 '14 at 07:13
  • Yes, it is clear they are using some such convention--but it is a mathematical error to do so, because the notation tells the reader to treat those zeros as if they were actual data. – whuber Aug 25 '14 at 13:12
  • I'm working on this PEVQ algorithm too! Well, I considering from 1 (in Matlab, index starts at 1) to nx-tau (to avoid Y[t+tau] exceed the limit). Remember that Y[t] (or X[t]) is zero padded, so both vectors are the same size. What about you, have you understood this notation (negative index) and how did you implement this correlation? – Diego Phoenix Aug 05 '15 at 01:00

0 Answers0