creating ideal filters
hey - I am working on a project using a bank of filtergraph objects acting as a number of filters.... 9 filters with octave band center freqs of 63, 125, 250 etc. (9 filters, 2 - low pass and high pass, and 7 bandpass)
I am passing pink noise thru the bank of filtergraph objects and have the bandwidth and q set on the filters to be approximately 1 octave wide...
I need to make the filters more of an "ideal filter" where it performs the equalization on only the frequencies contained in the octave band... and not affect the adjacent octave band...
any and all suggestions would be very helpful
thanks
mark
Check out the buffir~ example in the Max Examples folder (1/3 octave EQ
or something similar) Also, alternately consider using fffb~ instead
of filtergraph
Peter McCulloch
On Jul 18, 2006, at 5:22 PM, Mark LoRang wrote:
>
> hey - I am working on a project using a bank of filtergraph objects
> acting as a number of filters.... 9 filters with octave band center
> freqs of 63, 125, 250 etc. (9 filters, 2 - low pass and high pass,
> and 7 bandpass)
>
> I am passing pink noise thru the bank of filtergraph objects and have
> the bandwidth and q set on the filters to be approximately 1 octave
> wide...
>
> I need to make the filters more of an "ideal filter" where it performs
> the equalization on only the frequencies contained in the octave
> band... and not affect the adjacent octave band...
>
> any and all suggestions would be very helpful
>
>
> thanks
>
> mark
>
thanks -
i looked into using the fffb~ object and went on to using the filtergraph obj because i needed to have a dynamic gain on the octave band filters.
but the fffb~ could still work... I was checking the Dodge and Jerse book and there is this discussion about filters on pg 180 that says you can cascade multiple bandpass filters to form a filter with steep rolloff but with a wider passband.
can anyone help me on the mathematics here??
how do i best choose the combo of bandpass filter center freqs to create the most "ideal" filter????
thank you
mark
You can see this using filtergraph~ with cascade~. Instead of using
one filter with a high Q, use two filters set to the same frequency
with a lower Q. (if you have gain settings, you'll need to adjust
these) The result is a cutoff that is less prone to ringing.
I'm not sure how dynamic you need your gain to be, but fffb~ does
interpolation on gain. It's not signal rate, but it's quite
reasonable. Also, it creates some interesting effects by dumping
sudden changes in value on it.
Peter McCulloch
On 7/20/06, Mark LoRang wrote:
>
> thanks -
>
> i looked into using the fffb~ object and went on to using the filtergraph obj because i needed to have a dynamic gain on the octave band filters.
>
> but the fffb~ could still work... I was checking the Dodge and Jerse book and there is this discussion about filters on pg 180 that says you can cascade multiple bandpass filters to form a filter with steep rolloff but with a wider passband.
>
>
> can anyone help me on the mathematics here??
>
> how do i best choose the combo of bandpass filter center freqs to create the most "ideal" filter????
>
> thank you
>
> mark
>
hello again -
will cascade~ using filtergraph~ only take filtergraph acting as a bandpass????
i would like to use a combo of highpass, x number of bandpass, and a low pass to try and create these closer to ideal filters...
i can use a number of bandpass filters and tweak their Q and gain and freq and stuff, but it is only allowing bandpass
can i get a lesson on how to better control the filtergraph that is going into the cascade
thanks much for everything
mark
> hello again -
>
> will cascade~ using filtergraph~ only take filtergraph acting as a
> bandpass????
>
>
> i would like to use a combo of highpass, x number of bandpass, and
> a low pass to try and create these closer to ideal filters...
>
> i can use a number of bandpass filters and tweak their Q and gain
> and freq and stuff, but it is only allowing bandpass
>
> can i get a lesson on how to better control the filtergraph that is
> going into the cascade
maybe it's time to take a closer look at filtergraph~ inspector.
vb
vb -
filtergraph~ inspector simply describes the properties of any individual filter...
how is this supposed to help create ideal digital filters???
anyone and everyone -
can anyone tell me why only bandpass filtergraphs are allowable in cascade????
will all filtergraph signal processing behave like an analog filter??? is there no way to have a square wave shaped eq?? a square wave shaped frequency based signal processing system to split an broadband frequency source into individual octave band components, without affecting the amplitude of the octave bands is what i am looking to create. Any suggestions about how to do this would be greatly appreciated
is there not an object that will act as an ideal filter... in the digital realm, will there always be aliasing that cannot be accounted for????
i need to take a sound source (pink noise, white noise, playback file, etc.) and separate it into nine discrete octave band frequency chunks that will then be equalized by a separate part of my patch. the separation of the original sound signal should happen in a way where the amplitude of the octave band chunks of the broadband signal source are not affected in amplitude at all
thanks for your help and suggestions
mark
> filtergraph~ inspector simply describes the properties of any
> individual filter...
>
> how is this supposed to help create ideal digital filters???
seems i misunderstood you.
> can anyone tell me why only bandpass filtergraphs are allowable in
> cascade????
and this seems to be the source of my confusion. don't know what you
mean by "allowable", but you can have any other filtertype
combination (high, low, band, peak notch etc.) in cascade mode.
so,
>> i would like to use a combo of highpass, x number of bandpass, and
>> a low pass
although i don't see what this is good for, it is definitely possible
with filtergraph~/cascade~, but keep in mind that cascade~ is simply
a "cascade" of biquads in series - not parallel.
>
> will all filtergraph signal processing behave like an analog
> filter??? is there no way to have a square wave shaped eq?? a
> square wave shaped frequency based signal processing system to
> split an broadband frequency source into individual octave band
> components, without affecting the amplitude of the octave bands is
> what i am looking to create. Any suggestions about how to do this
> would be greatly appreciated
a truly square wave shaped eq is not possible. it's the same why an
"ideal" square wave can't exist in the digital domain without
aliasing. you would need a infinitely high sampling rate.
you can get close to "ideal" but at least one of the filter
quantification areas (flat passband, stopband attenuation, roll off,
phase response) will always suffer.
the transform pair of a square is a sinc. so using a sinc function to
design the filter kernel you get a more or less ideal lowpass filter.
with a little fiddling you can create a bandpass out of that. problem
of the sinc function is, that it's invinite...
you might want to read up on "windowed sinc filter".
other filter designs e.g. are butterworth (ideal flat passband),
chebychev or elliptic. all have their pros and cons i guess.
if you want to stick to cascade~ you want some of these in parallel
to have a filter bank, or look at fffb~.
to implement an arbitrary FIR filter kernel, you can look at buffir~
(not buffer) - (but, limited to 256 samples).
or go the spectral way by looking into fft~ or pfft~ and friends.
to separate the octave bands you will always have to run a few of
these in parallel -> costy.
>
> is there not an object that will act as an ideal filter...
i think trond lossius has made a butterworth filter implementation.
vb
On 25-Jul-2006, at 15:29, Mark LoRang wrote:
> is there not an object that will act as an ideal filter...
"Ideal" filters are called "ideal" because the word means "existing
only in the imagination".
What you are looking for is often referred to as a "brick wall"
filter. While DSP does provide some facilities coming closer to brick
wall filtering than analog processing (btw, you *have* looked at the
Forbidden Planet example, haven't you?), even Fourier processing
can't quite reach what exists only in the mind.
-- P.
PS: If you haven't looked at Forbidden Planet, your time would be
much better spent doing so rather than writing multiple question
marks. There ought to be a surcharge on superfluous punctuation.
-------------- http://www.bek.no/~pcastine/Litter/ -------------
Peter Castine +--> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de
vb -
thanks for the info, i appreciate it greatly
about the "allowable" thing - i was messing with cascade~ and somehow could only get the number of filters to change, but whenever i adjusted the characteristics of the filter (Q, gain, etc) they switched back to bandpass only
i guess my question is about the message box inputs into the filtergraph~ objects. i need a lesson on how to specify the characteristics of the filter. should i do multiple filtergraph~ object outputs into one cascade or can i do it with a filtergraph with multiple filters inside it?
and yeah, i realize that a exactly shaped square wave - ideal filter is impossible to create...
what i need is a close approximation (evidently better labeled a "brick wall") to control a broadband noise source in octave band frequency increments. my order of importance of filter quantification areas is 1. roll off, 2. stopband attenuation, 3. phase response, 4. flat passband
the broadband noise source that i am sending thru the eq bank is pink noise or constant noise like from HVAC systems, so i just need the "brick wall"
i'll check out the trond lossius lead
again, thanks mucho for the info
mark
Mark LoRang wrote:
> i guess my question is about the message box inputs into the
> filtergraph~ objects. i need a lesson on how to specify the
> characteristics of the filter.
yes ;-)
> should i do multiple filtergraph~ object outputs into one cascade or
> can i do it with a filtergraph with multiple filters inside it?
The latter, the filtergraph~ can talk to cascade~ in its cascade mode.
look at the filtergraph~ help file and print the messages filtergraph~
is sending to cascade~ to analyse them. Then you will understand how you
have to set up your messages without switching into bandpass mode...
> and yeah, i realize that a exactly shaped square wave - ideal filter
> is impossible to create...
Hard with biquad~/cascade~s, a brick filter is better done with an fft
based filter. look at the fft examples in the examples folder.
a fffb~ with many filters might be also an option...
Stefan
--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com
> i guess my question is about the message box inputs into the
> filtergraph~ objects. i need a lesson on how to specify the
> characteristics of the filter.
this is covered in the MSPReference.pdf.
i have put together a simple example of how to use filtergraph~ with
cascade~ to observe the behavior of cascading bandpass filters to
obtain a sharper roll-off (see link below).
> what i need is a close approximation (evidently better labeled a
> "brick wall") to control a broadband noise source in octave band
> frequency increments. my order of importance of filter
> quantification areas is 1. roll off, 2. stopband attenuation, 3.
> phase response, 4. flat passband
i think, if you really want to come close to a brick wall, you won't
get there with a recursive approach (biquad etc.).
you will need a FIR filter, i.e. convolution.
custom filter design is not an easy task and can get mathematically
pretty involved.
but i find the "window method", described in smith "digital signal
processing" (freely available online) and lyons "understanding DSP"
quite useful in this respect and comparetively easy to understand:
1. design (draw or whatever) the desired frequency response
2. take the inverse Fourier Transform (-> kernel)
3. shift the kernel by half it's length
4. truncate the kernel to the desired number of samples
5. multiply by a useful window (this is the remedy against "truncated
infinity")
6. take forward Fourier Transform to verify the frequency response
7. use the windowed kernel to perform time domain convolution (-
>buffir~) or, if the kernel is quite long, use the frequency
response to perform FFT-convolution.
i've put together a max-patch based on the above to give an idea of
how this could be done in maxmsp. i haven't tested this a lot, but it
seems to work. at least you can study the effect of windowing and
length of filter kernel vs. roll-off etc.
phase is not regarded in this example, i.e. it is set to zero.
for ease of use i implemented a blackman window. but you'd have to
study different window functions for pros/cons because they
effectively shape the frequency response of the filter.
you can find both patches here:
http://www.esbasel.ch -> downloads
hope this is useful to somebody.
comments and suggestions welcome.
vb
Here is a link to a tutorial on creating an FFT based analyzer. The same technique can be used to create brick wall filters with variable gain on each band.
There is that time/frequency resolution problem when using FFT so I dont know how well this will work for your application. Its worth a shot.