Home My Page Projects MPTK: The Matching Pursuit ToolKit
Summary Activity Forums Tracker Lists Docs News SCM Files

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: Gabor parameters and xml structure [ Reply ]
By: Andres Perez on 2012-11-09 15:09
[forum:110222]
Thank you very much for the fast anwer, Boris.

But that conduces to the next question: ok, the amp parameter is the L2 norm of a given atom, and sequential parameters may have bigger/lower amp values.

But anyway, atoms are ordered on the results file by their similarity with the signal or residual.

However, it seems to me that this information (which atoms are the most relevant ones) is presented in the results file only in qualitative form, and not by a quantitative form (I was thinking until today that this quantitativity was given by the amp parameter).

What I'm trying at the end is to find the "relevance level" of each atom.

For example, let's take an impulsive sound and another continuous.
With the impulsive sound, the first atom will take a big amount of the signal, and succesive atoms will have smaller amplitudes.
But with the continuous sound, all atoms should be amplitude and frequency equals, and only differ on the offset.

So I'm searching for a parameter that might say quantitatively how similar/different are succesive atoms, in order to be able (for example) to distinguish between impulsive and continuous sounds in the way above explained.

I don't know if the question was clear enough...

But thanks anyway,
Andrés

RE: Gabor parameters and xml structure [ Reply ]
By: Boris Mailhe on 2012-11-09 12:53
[forum:110221]
Hi Andres,

That is normal. The dictionary is not orthogonal (it cannot be when it is redundant), so subtracting one atom has an effect on correlations of the other atoms with the residual. Assume you have two atoms a and b and a signal s. Assume that a is selected at the first iteration, i.e. |(s,a)|>|(s,b)|. Then you compute the residual r = s-(s,a)a, and at the second iteration the correlation with b is |(r,b)|=|(s,b)-(s,a)(a,b)|. It can be higher than |(s,b)| if the signs are right and in that case, there is no reason for it to be lower than |(s,a)| either.

Hope it helps,
Boris

RE: Gabor parameters and xml structure [ Reply ]
By: Andres Perez on 2012-11-09 12:24
[forum:110220]
Sorry for taking back this thread, but I consider is something similar to what have been discussed here.

I observed a strange behaviour in some mpd extractions, as far as I understood it.
I was assuming that, as it was explained here before, the first extracted atom was the one that maximizes the L2 norm (amp parameter). Then this atom is substracted from the original sound file, and the process finish at some atom number or SnR or similar.

So, if I'm right, this implies that the first atom will have always more amplitude that the second one, because if not, the second one would have been the first one...

And I'm supposing that the order of atom's amplitude follows the appearance's order in the xml file.

The point is that, in some of the extractions, I'm getting some atoms with bigger amplitude that the first atom.

Is that possible? Is it normal? Should I then reorder the atoms afterwords?

Thanks,
Andrés

RE: Gabor parameters and xml structure [ Reply ]
By: Andres Perez on 2012-10-01 14:07
[forum:110091]
Allright. Thanks again Dan

RE: Gabor parameters and xml structure [ Reply ]
By: Dan Stowell on 2012-10-01 14:01
[forum:110086]
The atoms are not normalised to unit peak, but to unit L2-norm

RE: Gabor parameters and xml structure [ Reply ]
By: Andres Perez on 2012-10-01 13:56
[forum:110085]
Thanks Dan.
But I still don't understand it:

Let's suppose that my input is a normal audio file unit normalized.It has a peak with value 0.8, and this peak is captured by a gabor atom.
Then, the amp value in the description of this atom, in my oppinion, should be approx 0.8, but I'm getting values bigger than the unit.

So, my question is: if it is correct than the amplitude parameter is bigger than one, then it represents the amplitude with another scale different to the unit normalized.
So what scale is used?

Or maybe I'm confusing the amp meaning (I understand it in the common sense of amplitude)

RE: Gabor parameters and xml structure [ Reply ]
By: Dan Stowell on 2012-10-01 13:36
[forum:110083]
Hi Andres - it uses the scale of your input. The atoms are unit normalised, so the amplitudes are only the values required to reconstruct.

Best
Dan

RE: Gabor parameters and xml structure [ Reply ]
By: Andres Perez on 2012-09-27 15:44
[forum:110082]
Hi Dan and Remi,

thanks for you help.

I have still another question, regarding the "amp" parameter.
It is clear that it refers to the signal's amplitude.
However, I still don't know which scale it uses, since values are not [0,1]-normalized.
How can I interpret these values?

Thank you again,
Andrés

RE: Gabor parameters and xml structure [ Reply ]
By: Rémi Gribonval on 2012-09-24 12:37
[forum:110062]
Hi Andres and Dan,
I can confirm that the scale parameter is support>l
Regarding the broken XML, currently
-MPTK uses tinyxml for reading / writing dictionary descriptions, so these should comply with the XML standard;
-but the atoms/books are read/write with a pseudo-XML syntax. A clean XML input/output has been on a TODO list for a while and is still there due to lack of developper's time.
To avoid breaking 'someone's script' one could certainly imagine a 'legacy' scenario where the code that generates the broken XML can still be called explicitly, with a warning, until it is made deprecated.
Cheers,
Remi.

RE: Gabor parameters and xml structure [ Reply ]
By: Dan Stowell on 2012-09-24 10:40
[forum:110061]
Hi Andres -

You're right that the XML is broken, in two ways: (1) the extra "txt" added in the middle (no idea why!) (2) there is no root element, instead there are two separate elements at the root level. This needs fixing of course, but it'll probably break someone's script somewhere. In my own work I use simple text-processing to convert it to proper XML!

I'd prefer if an MPTK developer would answer the question about *scale* in the Gabor dict, but it seems to me the offset of each detected activation is given by support>p, and the duration of the atom by support>l, which can easily be transformed to scale if you're using a gabor dict. Both are measured in samples so divide by fs to get the value in seconds.

HTH
Dan

Gabor parameters and xml structure [ Reply ]
By: Andres Perez on 2012-09-24 10:10
[forum:110060]
Hello,
I'm having some problems by setting mpd work.

I'm interested on Gabor atoms decomposition. In the literature, normally a gabor atom is defined by its (scale,time,frequency,phase).
However, when I look the xml output description (for instance using the standard dic_gabor_two_scales.xml) I get amp, gauss, freq, chirp and phase, but no clue of scale or time.
Is there an equivalence?

Moreover, the xml output file seems a little corrupted.
I get it by using:
$ mpd -D dictionary/dic_gabor_two_scales.xml --n 100 sample1.wav sample1.wav.xml
In the reference, output has .bin output normally, but in this case I cannot look inside or parse content (I don't want to use matlab wrappers).
But in this xml output there is a very strange "txt" line between </dict> and <book ... >. I must edit the file before parsing it, because if not any parser will understand it.
So I don't know if I'm not right with the method or if efectively there is something strange on there.

Thanks,
Andrés