[mirtoolbox] Re: understanding mirnovelty

  • From: Olivier Lartillot <olartillot@xxxxxxxxx>
  • To: mirtoolbox@xxxxxxxxxxxxx
  • Date: Wed, 8 Jun 2011 18:13:37 +0300

Hi Hendrik,

I am sorry for this very late reply... (2 month after, exactly!) 

I would like to continue the discussion about mirnovelty:

> Please correct me if I'm wrong: I'm under the impression that the MIRToolBox 
> TimeLag representation is like Foote's time lag, but rotated by 45 degrees.

There is actually no rotation at all in the 'TimeLag' representation, neither 
in MIRtoolbox, nor in Foote lag domain transformation (equation 4 in Foote and 
Cooper). That transformation simply translates each column of the matrix 
vertically, but with a different translation for each column, so that in the 
end the diagonal becomes horizontal.

I am sorry I did not understand your matrix example. May I introduce another 
example?

For instance:

let's consider this simple original similarity matrix:

aaaaoooo
aaaaoooo
aaaaoooo
aaaaoooo
ooooaaaa
ooooaaaa
ooooaaaa
ooooaaaa

'TimeLag' transformation of the matrix:

uuuuuuuo
uuuuuuoo
uuuuuooo
uuuuoooo
uuuaoooa
uuaaooaa
uaaaoaaa
aaaaaaaa
aaaoaaau
aaooaauu
aoooauuu
oooouuuu
ooouuuuu
oouuuuuu
ouuuuuuu

Where 'u' are undefined points (outside the matrix).

Now let's say the kernel is this one (if we forget about Gaussian weighting):

aaoo
aaoo
ooaa
ooaa

Then the 'TimeLag' transformation of that kernel is:

uuuo
uuoo
uaoa
aaaa
aoau
oouu
ouuu

The convolution in the 'TimeLag' domain is very simple, just move the kernel 
horizontally along the matrix. The 'TimeLag' transformation is exact: there is 
no error introduced by any resampling, for instance.

>> - There were 1-sample imprecisions in the matrices and kernel: for instance, 
>> a (symmetrical) kernel necessarily needs to have odd sizes of the form 2N+1, 
>> with N rows above the diagonal and N rows below, right?
> 
> I gave this some more thought and disagree.
> Only if you insist on having a 1.0f somewhere, you need odd sizes for 
> symmetry.
> 
> A 2N (n=4) sized kernel could look like this (assuming no rotation):
> 
> 0.011108996f, 0.082085f,      -0.082085f,     -0.011108996f, 
> 0.082085f,    0.60653067f,    -0.60653067f,   -0.082085f, 
> -0.082085f,   -0.60653067f,   0.60653067f,    0.082085f, 
> -0.011108996f,        -0.082085f,     0.082085f,      0.011108996f
> 
> It looks a little odd, because it doesn't have a 1.0f in the center (because 
> there is no center), but it's completely symmetrical.
> 
> A 2N+1 (n=5) kernel would look like this:
> 
> 0.028565492f, 0.10836801f,    0.16901329f,    -0.10836801f,   -0.028565492f, 
> 0.10836801f,  0.41111225f,    0.6411804f,     -0.41111225f,   -0.10836801f, 
> 0.16901329f,  0.6411804f,     1.0f,           -0.6411804f,    -0.16901329f, 
> -0.10836801f, -0.41111225f,   -0.6411804f,    0.41111225f,    0.10836801f, 
> -0.028565492f,        -0.10836801f,   -0.16901329f,   0.10836801f,    
> 0.028565492f, 
> 
> Everything is symmetrical, but we have two issues:
> 
> 1) row 3 has to be positive first and then negative - I don't think this 
> corresponds to the strict definition (should there be one) of a checkerboard 
> kernel. Perhaps this case is easier to solve, when the kernel is rotated 
> somehow
> 
> 2) one has to decide whether the 1.0f in the center is positive or negative - 
> it can't be both.
> 
> 
> Therefore I believe that the even kernel is actually better suited (at least 
> for non-rotated kernels).

Sorry I was not clear at all when I spoke about odd size, I was only thinking 
of the number of rows of the 'TimeLag'-transformed kernel. I totally agree with 
you that the initial kernel should be even. (Like the one in my example above). 
It turned out, simply, that the transformed kernel has this time an odd number 
of rows. For instance in my illustration above, the transformed kernel has 7 
rows: 3 above, and 3 below the central row.

I would be very interested to hear your opinions about all this.

Thanks again for this very interesting discussion,

Cheers,

Olivier

Other related posts: