[CLAM] CepstralTransform

Rhywek rhywek at o2.pl
Mon Jul 18 05:05:56 PDT 2005


Hello, all.
I am running into a problem with MFCC extraction. Here is the relevant code:

...
      CLAM::XMLStorage::Dump(melSpectrum,
                   "melSpectrum",
                   "debugmelSpectrum.xml");

        CLAM::CepstralTransformConfig cepstralTransformConfig;

       
cepstralTransformConfig.SetNumMelCoefficients(floor(3*log(fs)));//It is
30 here
        cepstralTransformConfig.SetNumCepstrumCoefficients(13);
        cepstralTransformConfig.SetUseBase10(false);

        CLAM::CepstralTransform cepstralTransform(cepstralTransformConfig);

        CLAM::MelCepstrum melCepstrum;

        cepstralTransform.Start();

        cepstralTransform.Do(melSpectrum,melCepstrum);

        cepstralTransform.Stop();
        
        CLAM::XMLStorage::Dump(melCepstrum,"MFCC","MFCC.xml");
...

After execution the file "debugmelSpectrum.xml" contains one long line:
<melSpectrum><SpectralRange>22050</SpectralRange><CenterTime>0</CenterTime><Lo
wCutoff>0</LowCutoff><HighCutoff>22050</HighCutoff><NumBands>30</NumBands><Coe
fficients size="30">189.915 132.907 44.3864 34.6573 16.0021 26.2483
28.6773 17
.0859 38.7323 15.6943 17.6948 83.4548 52.0764 41.1847 25.1965 10.6456
11.1537
6.51261 4.43087 4.85767 4.84433 4.58867 4.33651 4.24629 4.20944 3.9518
3.70034
 3.66503 3.54066 3.77783</Coefficients></melSpectrum>

I suppose it is correct data.
But the file "MFCC.xml" contains oneline line:
<MFCC><CenterTime>0</CenterTime><LowCutoff>0</LowCutoff><HighCutoff>22050</Hig
hCutoff><Coefficients size="13">0 0 0 0 0 0 0 0 0 0 0 0
0</Coefficients></MFCC>

Now why the coefficients are all 0? I browsed the code of the Do method
and it should work as it is... I also wanted to debug it, but I ran into
different problem - I could not see the variables and objects. I use gdb
for debugging and if I write "p melFloor" or any other local variable,
it complains. So I tried to make it like this:
CXXFLAGS="-ggdb" make CONFIG=release -C build
but then I set the breakpoint like:
b CLAM::CepstralTransform::Do(CLAM::MelSpectrum const&, CLAM::MelCepstrum&)
But when I run the program with "run", the debugging was hardly
possible. When I tried to list the code with "l" it shown something like:
1      <<C++-namespaces>>: No such file or directory.
       in <<C++-namespaces>>

So could you please give me some hints how to debug CLAM programs in gdb?

Thanks in advance,
Rhywek.






More information about the clam-users mailing list