Filter: Allow a certain range of frequencies to pass (precise)?

Marcos's icon

I want to isolated certain ranges of frequencies...Right now I am using a bandpass filtergraph into biquad, but I want it to be exact. I want to be able to specify EXACT bands to let through, not just roughly do it with the bandpass.

e.g.

1) Only let 0-200 Hz, send somewhere in patch

2) Only let 200-600 Hz, send somewhere else in patch

3) etc...

Any ideas?

bkshepard's icon

I don't know of a filter that is that precise. Filters--even the steepest ones--all have a bit of a slope to them. Thus, I don't believe the ability to say up to 200Hz go this way, and 201Hz and above go that way is possible.

ComfortableInClouds's icon

try stacking biquads for a steeper slope. But there really is no such thing as a filter without some kind of slope.

Marcos's icon

Alrighty, guess I have to do it the hard way.

Was hoping there was something like Ableton's EQ3, which lets you specify 3 zones of frequencies exactly.

bkshepard's icon

I could be wrong--I don't have Ableton--but I bet if you did an actual FFT analysis on the output of that EQ, you would see that there is a fair amount of frequency bleed-through on either side of the cutoff.

jln's icon

Have a look at fffb~ which could help. You can also search the forum for "brick wall filter" or something. This particular thread can be of interest:

hth,
Julien

ComfortableInClouds's icon

yea, as shepard stated, ableton's EQ3 isn't EXACT frequencies - that's not really possible in DSP (or in analog processing for that matter). EQ3 is just meant to mimic the functionality of 3 band analog EQs you get on most mixers. Something similar could easily be built in MSP using 3 cascaded peaknotch filters.

volker böhm's icon

as others have already said, there is no such thing as an infinitely steep filter. if you're looking for good performance and phase-linearity is not an issue, you could go for a high ordered iir filter design like butterworth, chebyshev or elliptic.
otherwise fir filters can be realized in max with [buffir~].
using a sinc function as filter kernel one can obtain a very steep lowpass filter. there should be similar functions for highpass etc.

if you're on a mac and feel like trying one of the mentioned iir filters, you could check out vb.cheby~ form this sitehttp://www.esbasel.ch/Downloads/MaxMSP-Objects.htm
which implements a high order chebyshev hi/lowpass filter.

vb

d.'s icon

You could use the fiddle~ or pitch~ externals to detect exact frequencies.
If the output of fiddle~ was some number, the volume gets turned up, otherwise down.
That kind of thing.

Matthew Aidekman's icon

could also use pfft and split up the ranges that way

Alexandre's icon

forbidden-planet.maxpat in your max folder

Alexandre's icon

vb.cheby~ might the best choice to achieve this.

Adam Kendall's icon

One solution is a pair of crossover filters for each frequency range (one crossover on the bottom freq, the other on the top freq).

As others said, all filters have some kind of a curve -- A crossover's curve is so steep that it's effectively a sonic "brick wall", though reality is some unwanted frequencies will get in. Bet you can't hear them, though.

Here's an example that uses the tl.crossover~ external.

It's four nested patches. _ike.bandpass_demo.maxpat is the topmost patch. Open it first.

The display of the bpatchers may be messed up since I'm using presentation mode. Not sure if that info gets passed in compressed files.

_ike.bandpass_demo.maxpat

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

ike.bandpass_mono~.maxpat

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

ike.crossover_freq.maxpat

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

ike.line_flonum.maxpat

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

Adam Kendall's icon

"_ike.bandpass_demo.maxpat is the topmost patch. Open it first."

Actually, uncompress it last. Due to nesting, first uncompress and save the files in this order:

ike.line_flonum.maxpat
ike.crossover_freq.maxpat
ike.bandpass_mono~.maxpat
_ike.bandpass_demo.maxpat

Then, open _ike.bandpass_demo.maxpat to see how they're put together.

Wojciech Morawski's icon

You can also try to use fft~ filters. Here you can find free spectral filter http://lowertone.net/software/freeq/

Kasper's icon

the best solution I found to this problem/question (which was at the core of some music i did a few years ago) was using the GRM Tools bandpass filter (used the VST~ plugin inside max) - the steepest band pass I found, but which does not "push" the edges of the band (cascading biquads to filter say, 200-500 Hz range makes the actual border frequencies - 200 and 500 - way too proeminent.

hope it helps

kasper