[Clam-devel] Spectral Analysis/Synthesis

Xavier Amatriain xavier at amatriain.net
Fri Feb 8 06:58:54 PST 2008


Hi Karsten, let me try to jump into this conversation.

First, it is great to know that somebody is looking into using CLAM with 
the reactable. Some of us still remember that this was the initial plan 
when the reactable project started. Unfortunately at that point CLAM was 
not production ready and it was much easier to use Pd. I really hope you 
are successful in your project: it would make us very happy in CLAM :-)

Now on to the technical details....

I have to contradict Pau, using the FFT/IFFT directly is not a very good 
idea unless you think you can manage things like windowing, overlap, 
etc... on your own. Spectral Analysis/Synthesis is the way to go.

Next, I see that you are using non-default config parameters in your 
analysis/synthesis process. This is very likely to be part of the 
problem so I would recommend sticking with standard default values until 
you get things working and then move onto yours. I don't see anything 
suspicious in your settings but it might be that using a "non standard" 
sampling rate has uncovered a bug, who knows.

Looking at your code, the most likely reason you are having a problem is 
incorrect management of hop vs. window size. This is what Pau was saying 
that was solved in Ports but you will have to manage yourself. The key 
thing to remember is that although you are always inputting and 
outputting FrameSize samples to the process, some internal Processing 
Objects (such as the FFT) will need WindowSize samples to work. 
Therefore, in your case, you might need to input two Frames before you 
can even do the FFT.

Also, for future reference, if you are trying to implement Spectral 
transformations in between those processes (I bet :-) you should at 
least work with a hopSize of 1/4 the WindowSize. Considering the default 
WindowSize is 1024 you should go into 256 hop size or increase the 
WindowSize (and therefore latency) to 2048. In any case, this should 
only be a problem if you do transformations but not now.

Xavier

Karsten Krispin wrote:
> Am Donnerstag, 7. Februar 2008 22:39:24 schrieb Pau Arumí:
>   
>> On dj, 2008-02-07 at 22:25 +0100, Karsten Krispin wrote:
>>     
>
>   
>> SpectralAnalysis is appropriate when you need to do hard spectral
>> transformations. If you don't, don't use it, but use the FFT (and IFFT)
>> directly.
>>     
>
> What do you mean by "hard"? Like complex transformations, or...?
>
> Well, one purpose is to mix together some streams. I think I don't have to 
> explain you how the reactable works.. :) so.. Like the mixing which has to be 
> done in the sink... to get all synth-items together. 
>
> All in all I have to admit that I'm more or less new to the DSP..  I 
> understand the technics behind it and stuff,  but I cannot refer to deep 
> knowledge. 
>
> I understand that when transforming (like changing amplitudes in 
> frequency-domain) errors occour when synthing again the signal. 
>
> So.. what could called to be complex then...? Is mixing together some streams, 
> or changing some frequencies amplitude be considered complex?
>
> Or if I just want to build a resonant filter: Setting all amplitudes to zero. 
> For, this is nothing "complex"... well..
>
> But I also would appreciate some hints where I can read about this in detail. 
> Unfortunately CLAM-Docs are bare informative about this all.
>
> Greetings,
> Karsten
>
> _______________________________________________
> Clam-devel mailing list
> Clam-devel at llistes.projectes.lafarga.org
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel
>   






More information about the clam-devel mailing list