Question: Realtime convolution using pfft~

SY's icon

Dear Great Max-lovers,

I have a simple question which I want to get a thorough understanding of pfft~ and realtime convolution in Max/MSP.

If I design a FIR filter, I usually use buffir~ object but the buffir~ limits the number of taps.
For a longer FIR filter (such as a room IR), I want to make a pfft~ based fast convolution.
I know that I can use HISSToolBox for this purpose ... but I want to try and design my own one.

In my first trial, I compared buffir~ and pfft~ for a short FIR (2048 taps), expecting that those two would generate same results.

But the results were quite different.

If one of you could let me help to debug this and remove this difference, it would be helpful for me to move forward.


Many thanks in advance.

myfft.maxpat
Max Patch

playgroundConvolution3.maxpat
Max Patch

Roman Thilenius's icon


you dont really do it in an (p)fft, it is theoretically possible, but not in practice.

and when i understand it right i would be limited to 4096, hardly enough for a small room´s first reflections.

http://www.pescadoo.net/annexe/max/index.html

https://en.wikipedia.org/wiki/Dirac_delta_function

SY's icon

You wrote: "but not in practice"
Does it mean that "practically" Max's (p)fft cannot produce the exactly same convolution result as buffir~?

volker böhm's icon

Does it mean that "practically" Max's (p)fft cannot produce the exactly same convolution result as buffir~?

No, a pfft based convolver can produce the same output as buffir~. But it is not suitable to create a convolution reverb with it.
You might read up on partitioned convolution.

SY's icon

That's what thought (and believed) but the patch that I generated demonstrates the difference between buffir~ and pfft~.
That's why I started this question...

volker böhm's icon

the patch that you posted is missing the pfft patcher, so nobody can tell...

SY's icon

ouch... my bad.. i will fix the original posting

--> Now fixed

SY's icon

@Volker Bohm,
You wrote to my question on March 27th
>> looks like you are experiencing time aliasing caused by 'circular convolution' - there's a nice explanation in smith's dsp-guide for a comparison of time domain convolution (buffir~) and fast convolution (using pfft~) in class I'm using the attached patch. maybe this gives you some clues.

But now I cannot find your reply and patch example. Would it be possible for you to upload it once again?