# [chuck-users] bandwidth in band reject filter

Michael Heuer heuermh at gmail.com
Mon Oct 27 23:40:52 EDT 2014

```Thank you, Spencer.

It's still going to take me a bit to catch up with the math.

For a SawOsc at 220.0 Hz through a BRF at 880.0 Hz Q has rather
interesting behavior between 0.01 and 0.03, cuts out at 0.04, and then
doesn't seem to change much between 0.05 and 1.0.  I made a

http://youtu.be/Z3uBNUfvih4

And sorry, no sound.  I should learn how to use internets someday.

michael

On Mon, Oct 27, 2014 at 5:24 PM, Spencer Salazar
<spencer at ccrma.stanford.edu> wrote:
> Hey Mike,
>
> I usually assume that mathematically Q = f / Δf and this hasn't gotten me in
> trouble yet, but I am not a real audio engineering guy so maybe this could
> be false in some cases.
>
> In ChucK's case, for brf, the code looks like this:
> [...]
>     // set_brf
>     inline void set_brf( t_CKFLOAT freq, t_CKFLOAT Q )
>     {
>         t_CKFLOAT pfreq = freq * g_radians_per_sample;
>         t_CKFLOAT pbw = 1.0 / Q * pfreq * .5;
> [...]
>
> so in that last line, Δω = ω/(2Q), so Q = ω/(2Δω) = f/(2Δf). I don't know
> for sure if the extra 2 in the denominator is a scaling factor or actually
> part of the Q-bandwidth relationship for this filter. I would be surprised
> if it was the latter though given the "standard" definition of Q one sees,
> given above.
>
> I can see how it would be confusing because the term Q is also used for the
> LPF and HPF filters as resonance, which is the gain of the peak at the
> cutoff frequency, in which case the f/Δf relation is not correct or even
> applicable.
>
> spencer
>
>
> On Mon, Oct 27, 2014 at 12:34 PM, Michael Heuer <heuermh at gmail.com> wrote:
>>
>> Hello,
>>
>> I'm currently using the C*APS Eq10 10-band equalizer
>>
>> http://quitte.de/dsp/caps.html#CAPS_for_Electric_Guitar
>>
>>
>> https://github.com/jwmatthys/chugins
>>
>> as part of an effect but all I really need is something to scoop the
>> mids.  I thought I might use the BRF band reject filter
>>
>> http://chuck.cs.princeton.edu/doc/program/ugen_full.html#BRF
>>
>> I can't tell how to set the bandwidth (or described another way, the
>> range of frequencies around the center frequency that are rejected by
>> the filter).  I went off into reading Miller Puckette's book Theory
>> and Techniques of Electronic Music
>>
>> http://msp.ucsd.edu/techniques.htm
>>
>> and am now lost somewhere in the imaginary plane.
>>
>> The definition of the Q parameter seems to vary among the different
>> ChucK filters (resonance vs quality vs Q) and I suppose I should
>> understand what that means.  Feel free to tell me to go back to my
>>
>>    michael
>> _______________________________________________
>> chuck-users mailing list
>> chuck-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>>
>>
>
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
```