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: Anywave, and sliding templates on spectrograms [ Reply ]
By: Dan Stowell on 2013-03-13 10:57
Bob points out that vectorising the spectrogram and the templates would address this pretty straightforwardly, with no need for channels. Thanks!

Anywave, and sliding templates on spectrograms [ Reply ]
By: Dan Stowell on 2013-03-13 10:00
Dear all,

I've been using a simple cross-correlation template matching to detect patterns in spectrograms, with 2D time-freq templates. It occurs to me that MPTK could give me this functionality directly, if I were to use "anywave" and provide the templates using one "channel" for each frequency bin.

There's one refinement to this, though, which is that I'd like the template to slide in time as well as frequency. As a simplified example, if I analyse a spectrogram with 5 frequency bins, using a template which is 3 bins high, there are 3 possible frequency offsets to check.

MPTK doesn't seem to have the possibility for this offsetting, which is not a surprise since offsetting the "channel" is a strange idea when you aren't thinking of frequency bins. To manually implement it, I could convert a 3-bin template such as
[0.1, 0.5, 0.4]
into multiple full-range templates:
[0, 0, 0.1, 0.5, 0.4]
[0, 0.1, 0.5, 0.4, 0]
[0.1, 0.5, 0.4, 0, 0]
This presumably would work, but it obviously increases the size of the anywave dict significantly. (I'd normally be using multiple templates, each one being about 80 bins out of 256, which means creating 176x more templates if doing it manually...)

Anyone worked with issues like this in MPTK? The idea of a 2D sliding template is fairly common, so I wonder if you think it would be a worthwhile feature in MPTK.