## splitting the signal from FFT in to separate bands

Feb 29, 2012 at 7:44pm

# splitting the signal from FFT in to separate bands

Hey guys,

I am having a little bit of trouble wrapping my head fully around fftin/fftout objects.

I am looking to make a high resolution filter, that multiply each frequency bin by a value.

Is there any way I can get each separate frequency bin out of an FFT~? and if not, would I be as well splitting the input signal, and then performing separate FFTs? This option seems inefficient and I was wondering if anyone had some advice! cheers folks

#62047
Mar 1, 2012 at 9:03pm

did you go through MSP tutorials 25 and 26? i suggest you to use pfft~ instead of fft~. because fftin~, inside pfft~, outputs phase and amplitude for each bin. So if you want to eliminate for instance the energy in bin 10, you can say: when FFT index is 9 (i think it counts from 0), multiply amplitude with 0.

But probably you would like to have some graphical interface for your filter, to draw the filtering curve. What you need is a lookup table, where you store all the multipliers for each FFT bin, and control them graphically (x axis – number of bins, y axis – values from 0. to 1.). Since you want to read this lookup table with audio signal, you can treat a buffer~ as your lookup table (and edit it with waveform~), or you can take the Jitter path. I suggest you to read this article “David Kim-Boyle: Spectral Delays with Frequency Domain Processing”. There you will find the buffer~ solution. The article is about spectral delays, but the concept is the same – instead of delaying each separate bin, you want to scale the amplitude information. But after that I suggest you to move to Jitter. Use multislider object and jit.fill (see jit.fill helpfile) to generate a one row matrix (your lookup table) and then read it wit jit.peek~.

The problem with multislider is that the maximum number of slider is 255. So if you would like to have a bin accuracy at larger FFT windows (larger than 512), you will need to use table object and rework it a bit to work for you as multislider. The next step would be to make a logarithmic interface…

PS: In few days time I will post my dissertation with patches to the forum where this topic is covered in details.

#224131
Mar 2, 2012 at 12:42am

Or just use multiple multisliders and offset them by 255, if I’m thinking about this the right way.

#224132
Mar 5, 2012 at 3:44pm

Thanks so much for the awesome replies!

I have decided to go down the jitter route, as it seems to make more sense to me.

I have managed, through use of a '==~ 5' object going in to a gate, and using the multislider to choose between bins and changing their magnitude, create something similar to what I need.

my only problem is that I would need to make around 43 of these objects so I can change each bins magnitude via each slider (by my logic which is probably flawed).

I am looking at the jit.fill object, and I can see how that would output a list of all the different magnitudes per bin slider, but do you have any suggestions as to how I would do this per band?

I will upload a picture of the patch I am currently working on if it gives you an idea of where I am at.
If its too complicated to explain, that's cool, I appreciate your help so far, its pushed me in the right direction i think :)

Dave

[attachment=187258,3485]

###### Attachments:
#224133
Mar 5, 2012 at 6:01pm

What about forbidden-planet.maxpat ? You have it in the examples/fft-fun folder in the MAX distribution

#224134
Mar 5, 2012 at 8:05pm

I should really go through the examples folder again, I pretty much put together something like that forbidden-planet patch a couple of weeks ago :-/

#224135
Mar 6, 2012 at 1:09pm

forbidden-planet patch is definitely one way how to do that. but i still prefer using pfft~. i made an equivalent patch to forbidden-planet for you (see attachment below) which…i don’t know, seems easier to me.

the idea is that FFT index from fftin~ constantly loops (reads) through the list, generated with multislider. and that you multiply each amplitude value from every single bin with each corresponding EQ value from multislider. so you have to write the list into a matrix (as a one row and one plane matrix) and constantly read it with jit.peek~, where FFT index from fftin~ should control the reading position of jit.peek~. See tha path in the attachment…

###### Attachments:
1. FFTEQ.zip
#224136
Mar 6, 2012 at 3:39pm

er, forbidden-planet does use pfft~…

#224137
Mar 6, 2012 at 8:11pm

ups, sorry, you’re right. i was checking jit.forbidden-planet.maxpat, which doesn’t.

well in that case, the difference between my patch and forbidden-planet is the use of one row matrix instead of buffer~. the advantage of using matrix is IMO significant, since one can use graphical effects to change the EQ curve.

I added two jitter effects to transpose and to blur the EQ curve. To clearly see the effect try some spikes as an EQ.

for proper blurring some gaussian blur would be needed, but i avoided that since it is available only in opeGL. but i can add it if needed…

PS: the pfft~ patch was not modified so use the one from my previous post (FFTEQ.zip)

– Pasted Max Patch, click to expand. –
#224138

You must be logged in to reply to this topic.