[Clam-devel] [PATCH] Hacking ClamExtractorExample (incomplete)

David García Garzón dgarcia at iua.upf.edu
Fri Jun 29 02:56:52 PDT 2007


Yes it is pretty close to a final patch. There are just three points there:

1- For sure the Spectrum has not just 50 bins. Execute the extractor just by 
printing the SpectralRange and the Size of the first frame in order to know 
the right parameters. First bin in spectrums is always 0 and the InterBinGap 
is SpectralRange/Size.

2- The proper spectrum attribute is MagBuffer not Mag. It is a CLAM::Array so 
you should assign it in a different way.

3- The Spectrum object has a nasty complexity that we would like to remove but 
until them we should cope with it. Spectrum contains several representations 
such as mag/phase, complex... which might be present or not and, when added, 
they need to be synced. So check whether the first frame spectrum 
HasMagBuffer. If it has, don't hesitate, if it has not, then we'll talk about 
how to add and sync.

The UpdateData patch is ok. Indeed we should apply it. What is longer for you, 
sending a separate patch for this issue or sending the full patch?


On Friday 29 June 2007 05:33:44 bennett kolasinski wrote:
> (Sending this patch to the list for the sake of open communication with my
> GSoC mentor even though it is INCOMPLETE-- please do not apply to your
> sandboxen!)
>
> David-- I have been modifying ClamExtractorExample and I think I'm pretty
> close to a complete patch for this step, but I'm not sure what attribute to
> add for the SpectrumMagnitude WritePool (as per your suggestion of
> populating the WritePool in MFCC2Pool).  I was thinking something along the
> lines of spectrum.GetMag but I don't think that's right.  Line 597 of
> ClamExtractorExample.cxx (after applying my patch) is the one i'm
> questioning.  (This code compiles and runs but doesn't do anything
> interesting).  Suggestions?
>
> BTW-- I had to call schemaAttribute.UpdateData() after adding the new
> properties but before populating them or else I get a crash when running
> the extractor, so that's in this patch too.
>
> Thanks!
> B
>
> On 6/28/07, David García Garzón <dgarcia at iua.upf.edu> wrote:
> > On Wednesday 27 June 2007 20:11:01 bennett kolasinski wrote:
> > > Incorporated some of David's comments into my earlier patch and
> > > trickled new features into SchemaBrowser... please disregard patch from
> > > earlier today! B
> >
> > Commit r10295
> > Thanks, Bennett.
> >
> > Next step, make the ClamExtractorExample generate such kind of
> > FloatArray: * On BuildSchema, add a call to add
> > 'Frame::SpectrumMagnitude', guess or invent the bin gap and offset.
> > * On MFCC2Pool get the write pool for such attribute and fill it.
> > * Regenarate the example pool data
> >
> > Further step, make feasible to visualize such FloatArray attributes, in
> > PoolFloatArrayDataSource (PFADS) and InstantViewPlugin:
> > * PFADS::nBins() should be taken from the new attribute property NBins if
> > available, if not, from the labels size as it is done now.
> > * PFADS::getLabel should return:
> > ** The binLabel if bin<_binLabel size.
> > ** A numeric representation if the needed attribute properties is
> > available
> > ** Empty string or 'ERR' if not
> > * For BarGraph filter FloatArrays without binLabels AND without NBins
> > * Adapt all the InstantViewPlugins to use the NBins when available.
> > * Run the Annotator, add a BarGraph for SpectrumMagnitude and send a
> > development screenshot to the wiki ;-)
> >
> > Very further step: Add a view for temporal evolution of FloatArrays
> >
> > Consider to put this todos on the wiki, modify them as you feel or as
> > problems
> > emerge, and check them when done.
> >
> > David.






More information about the clam-devel mailing list