splitting the signal from FFT in to separate bands
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
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.
Or just use multiple multisliders and offset them by 255, if I’m thinking about this the right way.
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 :)
What about forbidden-planet.maxpat ? You have it in the examples/fft-fun folder in the MAX distribution
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 :-/
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…
er, forbidden-planet does use pfft~…
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)
----------begin_max5_patcher---------- 1177.3oc6YkrjihCD8r8WgBh9nGOZis4TO+Ay8N5nBYiraUCHH.4pbOcz029 fj.uMrUzXJeXtPfDf3kOx7kYJ9wxENaROxKb.+A3KfEK9wxEKLSomXQ03ENI riaiYElayIgWTv1ycVYulheTYlOc2tBt5oifOgpu1tTopP7Ob80Qv0vpokGR DxXtxrd3ySldPUOKpZ1LlZ62Dx8Oky2prnjP8V6tBP70KHvMTeD4sFB9Z0yH hr3Yyy+F4JnHYIFn37m4BVb8UruU02y3102wA7U8U94xk5CqFHsTh+M772ik iZzxwcX4dFSlfHFK2L.EzrkiCFgkKjJmU.mML4dmSKZFKu7oU77m3R1lXy8B GCAwesDX+G2FEXCPbeosJGFpg1HX8fVosvQPaF9Zkk9FmuSyTyyB057TEC74 MoGjQIoQb.5tRUXpqgiB8M9VHbmtX9ifqJsomRXpbwQMi8vFpgCIZ2DrUdom PM2+OTql1BLLENHb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