[Clam-devel] Spectral Analysis/Synthesis

Karsten Krispin karsten.mailinglists at krispin.de
Mon Feb 18 06:10:55 PST 2008


Hi Xavier!

Am Sonntag, 17. Februar 2008 23:05:28 schrieb Xavier Amatriain:
> The effect you are experiencing can be due to several things but all of
> them are due to inconsistency between window sizes and/or hopsize.
> Could you paste the relevant part in your code where you configure the
> CLAM objects? 

Configure-Stuff:

int samplingRate = 48000, frameSize = CLAM::AudioManager::Current().Latency();
	
CLAM::SpectralAnalysisConfig specAnalConf;
CLAM::SpectralSynthesisConfig specSynthConf;
CLAM::OverlapAddConfig	overlapConf;
	
specAnalConf.SetSamplingRate(samplingRate);
specAnalConf.SetHopSize(frameSize);
specAnalConf.SetWindowType(CLAM::EWindowType::eKaiserBessel35);
specAnalConf.SetWindowSize(frameSize*4+1);
this->_specAnal.Configure(specAnalConf);
this->_specAnal.Start();
	
specSynthConf.SetHopSize(frameSize);
specSynthConf.SetSamplingRate(samplingRate);
specSynthConf.SetAnalWindowType(CLAM::EWindowType::eKaiserBessel35);
specSynthConf.SetAnalWindowSize(frameSize*4+1);
	
specSynthConf.SetSynthWindowSize(frameSize*4+1);
	
this->_specSynth.Configure(specSynthConf);
this->_specSynth.Start();
	
overlapConf.SetFrameSize(frameSize);
this->_overlapAdd.Configure(overlapConf);
this->_overlapAdd.Start();
	

This is the way I create the temporary buffer in WindowSize (package is a 
CLAM::Frame) :

Analysis:
CLAM::Audio tmpAudio;
tmpAudio.SetSize(package->frameSize()*4);
CLAM::TIndex index = (package->frameSize()*2)-(package->frameSize()/2);
tmpAudio.SetAudioChunk(index, package->GetAudioFrame());

this->_specAnal.Do(tmpAudio, package->GetSpectrum())

Synthesis:

CLAM::Audio tmpAudio;
tmpAudio.SetSize(package->frameSize()*2);
	
this->_specSynth.Do(package->GetSpectrum(), tmpAudio);
this->_overlapAdd.Do(tmpAudio, package->GetAudioFrame());


> Also, have you tried what happens when you use 
> default configuration params?
The same problem...


Thanks,

Karsten




More information about the clam-devel mailing list