Split signal into individual bands

Hugo Villanova's icon

Hello,

I want to split a signal into 32 individual bands (like band pass) but very narrow bands. Already tried fffb , cross, biquad but it seems not making like the image attached. Does anyone knows how to achieve similar result?

Jean-Francois Charles's icon

fffb~ or biquad~ (bandpass) seem to be good options for that.

For the record, the bands you are showing here are not very narrow.

Stevon's icon

if you put two biquads in serial, one highpass and one lowpass, you can set the individual bandwidth to your liking. I guess this way you should get the results you looking for.
Greetings

Hugo Villanova's icon

Already tried both…but for some reason it keeps passing signal before or after the frequency range…I need like a brick wall… like from (example) 20 to 50 one band , from 50 to 100 another band and so on…

Hugo Villanova's icon

Imagine this but Instead of bars…a band pass…hope this way is more objective

Roman Thilenius's icon

like stevon said, you should simply use more filters, in serial order, to get a higher order filter.

since this does not work with fffb~, you must use a group of reson~ instead (which is technically the same filter)

if you do not need more than 32 and the frequencies do not have to be exactly a ertain scheme, you could also use a huge FFT for this, but it has quite some learning curve.

Hugo Villanova's icon

Basically what I need is the amplitude values of each frequency range between for example between 20 and 50 hz to get like an average level of this range of frequencies thanks for your help. Reson~ doesn’t seems to work…

Tikoda's icon

Mc,bands~ and mc.peakamp

Wil's icon

Here is a little module I made using paired vb.cheby~ filters. Then I made about 50 copies to sweep through different sections of the same audio file. (just change my output and add peakamp)

You can get a very narrow band at the top, but it will curve away at the bottom.

Max Patch
Copy patch and select New From Clipboard in Max.

Stevon's icon

Okay I see, your first picture was a little unclear about the filter steepness you want to achieve.

Not quite sure what you want to build but I guess multiple reson~should be the best option for you, because the "bleed", depending on you're Q Values is nearly not audible.

Either way here are the Filtering Options you have I guess, if you don't want to go FFT:

Max Patch
Copy patch and select New From Clipboard in Max.
Hugo Villanova's icon

what I really want to achieve is a colored waveform like we see in dj softwares....like a spectral colored waveform. but I really a beginner and I don't know exactly how to do this. what I really want is this :

  1. Spectral Analysis:

    • Use the fft~ object to perform a Fast Fourier Transform on the audio signal, converting it from the time domain to the frequency domain.

  2. Magnitude Calculation:

    • After the FFT, use the cartopol~ object to convert the complex FFT output to magnitude and phase.

    • You'll be interested in the magnitude information.

  3. Frequency Binning:

    • Divide the frequency range into bins. This can be achieved using the spectroscope~ object, which provides frequency binning functionality.

  4. Weighted Summation:

    • Multiply each bin's magnitude by its corresponding frequency.

    • Sum up these weighted magnitudes across all frequency bins.

  5. Normalize Spectral Centroid:

    • Normalize the obtained sum to a range that corresponds to the color mapping you'll use. This can be achieved using the scale object.

  6. Color Mapping:

    • Define a color palette that maps the normalized spectral centroid values to colors, as explained earlier.

  7. Apply Color to Waveform:

    • Use visual objects like jit.pwindow, jit.lcd, or jit.gl.sketch to display the waveform.

    • Apply the colors generated in the previous step to the waveform based on the spectral centroid value.

  8. Visualization:

    • Connect the audio input, spectral analysis, spectral centroid calculation, color mapping, and waveform visualization components together in a Max MSP patch.

    • Ensure proper signal flow and parameter settings for each object to achieve the desired effect.

Hugo Villanova's icon

thank you so much for your help.

Jean-Francois Charles's icon

This script reads like an "AI"-generated script! Anyway, you can do something simple with 4-5 filters first. Try 4 biquad~ objects. A lowpass, 2 bandpass, 1 hipass. Go super-simple and use [meter~] to get the amplitude out of biquad~!! (or use average~ etc.)

Then, when you have 4 numbers, use them to create the color you want.

Coloring a waveshape is more work, you'll have to work on that separately.

Hugo Villanova's icon

hello jean,

I already tried with multiple things...Reson~, biquad~, svf~, filterdesign, but it doesn't display like this.

Jean-Francois Charles's icon

A traditional way to ask questions on this forum, especially if you have tried things, consists in sharing the best version of what you have. Many users will help you much more easily this way.

Quick proof of concept patch below with 4 filters and a discrete color selection based on filter with maximum energy.

Now, to get your results, you'll need to spend time studying how you DJ software of choice colors every part of the waveform. Do they mix the colors, or is it more a pick of the color depending on the "strongest" part, with some priority rules. Also, you will need to experiment and choose how many filters to use. My guess is that they don't use more filters than a Moog vocoder, maybe even less. You could experiment with adjusting the exact frequency ranges (I would start with typical ranges for a vocoder, engineers spent a lot of time refining these choices of bands over decades).

Now, of course, coloring the waveform is another step, which will certainly be best done in OpenGL.

Max Patch
Copy patch and select New From Clipboard in Max.
Hugo Villanova's icon

hello jean,

thank you so much for your reply....
but I'm doing something wrong positive sure.

This one is what I did based on your patch...

but the colors is not like in frequency range...maybe??

Max Patch
Copy patch and select New From Clipboard in Max.
Hugo Villanova's icon

I made a new version as well, but its the same situation....not exactly like traktor or other dj software...the information on the web is not clear enough (maybe is my knowledge is not there yet), and ai tools for this kind of things is very vague as well....

Max Patch
Copy patch and select New From Clipboard in Max.
Jean-Francois Charles's icon

I'm pretty sure you don't need that many filters.

My suggestion if you are really serious about that is to test the software you want to imitate: which colors appear when you feed it a sine wave rising from 20Hz to 15kHz? That is going to give you a first layer of information. Maybe you'll start seeing how many colors they are using, and how many filters they are using.

Next, feed it 2 sine waves, a strong rising one, and a different frequency with smaller amplitude. Do color change? If yes, then the coloring is a mix. If no, then the coloring is based on strongest frequency.

Then, you'll have already a good basis of information to come up with more analysis, more tests if needed.

Hugo Villanova's icon

I read in a python forum that containing a 10 second sine sweep from 20hz to 20khz it shows like this...and all of this is combined to perform this waveform color...but i don't get it.

Hugo Villanova's icon

basically is Waveform with spectral centroid color.

Hugo Villanova's icon

do you guys know how to achieve this?