[Clam-devel] Configuring Spectrum Ports

Pau Arumí parumi at iua.upf.edu
Sat Apr 14 05:26:03 PDT 2007


En/na Xavier Amatriain ha escrit:
> I am wondering, is there a way to configure a pair of connected 
> Spectrum Ports?
>
> The issue is that some CLAM Processings are able to operate on any 
> kind of Spectrum
> but they are extremely inefficient depending on the format (Mag/Phase 
> or Complex).
> Is there a way to tell the StreamBuffer that you don't want the 
> default format?

Well, this is a current design weakness.
StreamBuffer<DataType> is a template class so you can't do custom 
initializations from there.
However, the processings can do such initializations (and there are 
examples of that. The recent mfcc-related processings for instance). The 
problem is that currently there is no a "good" solution. The 
streambuffer allocation is not done at configuration time but on 
ports-connection time so processing's ConcreteConfigure()  might not be 
the right place (at least it is not for NetworkEditor usage). So as a 
provisional solution we do it inside the Do(). That means that within 
the Do() it checks the format and changes it, if necessary. Of course 
this re-formating will only happen the first Do(). (or in the few firsts 
Do's, depending on the ports size)

There is the "down-stream parameter propagation" idea that, i think, 
would give an elegant solution to that kind of problem.

But for this concrete problem, i'd rather do the much needed "one 
spectrum representation per class" refactoring. I'm willing to help on 
that. Is this refactoring going in your direction?

pau




More information about the clam-devel mailing list