Hi,

I am struggling to build a system to estimate the spectral coherence between 2 signals in AudioWeaver. Computing the FFT, complex conjugate, magnitude, and magnitude square is not a problem. What I cannot figure out is how to compute the FFTs of a number of consecutive blocks, say 4, and then compute the average frequency response across the 4 blocks.

Thanks.

Pablo F. Hoffmann

Hey Pablo,

If I'm understanding your problem correctly, you can use the BufferUp or Rebuffer module to increase the effective block size by a factor of 4, then run your FFT on those larger blocks.

Let me know if this doesn't answer your question.

Thanks

-Axel

Hi Axel,

Sorry I wasn't clear enough because that is not what I meant. Say I have a 1024-sample block, what I need is to run FFTs on 4 consecutive blocks of 256-sample and average the *FFT results* across blocks, i.e. I should get a 129-point frequency vector where each point is the average across 4 data points. It is similar to how the Welsh periodogram is computed, and the average part is critical because I am interested in the squared spectral coherence too. If the coherence is computed directly on raw data, i.e. without average, the result across frequencies is always 1 which is not useful.

Does that make sense?

Thanks.

Pablo F. Hoffmann

Thanks for the clarification. I believe this layout accomplishes your goal, though it is simplified to just two 256 sample blocks rather than 4. The key for computing the average is the SampleStatistics module.

Does this help?

Thanks

-Axel

Hi Axel,

That works. Really appreciate your prompt reply.

Thanks.

Pablo