Filter question: How do I calculate the capacitance here?

Started by midwayfair, January 14, 2015, 10:12:44 AM

Previous topic - Next topic

midwayfair

Let's say I make the following two filters:

38K source ->(high impedance)
                  |
               250K variable resistor
                  |
               6.8nF
                  |
                Ground

AND

38K source -> 250K variable resistor ->(high impedance)
                                                      |
                                                    1nF
                                                      |
                                                    Ground

#1 is common as dirt, but I never see it fully explained. (This caused me some confusion early on, because like most new builders, I didn't understand source impedance being used as part of the calculation, so I didn't understand why the same pot and capacitor would sound darker in one build but not another.) #2 is the Rat's filter, but I changed the values to get the same starting point frequency.

-The lowest cutoff frequencies of each of these filters is almost identical. In #1, the level of the 615Hz cut is varied, with the 250K acting as a voltage divider with the 38K source impedance. In #2, the -3dB cutoff frequency is varied from a maximum of 4188Hz to 616Hz at max resistance.

-They are both 6dB per octave cuts.

-I understand that in #2, the 250K will divide against the impedance of the following stage, but I'm only interested in the filter cutoffs. I have a pretty good handle on #2 and it's easy to calculate the cutoffs frequencies in all cases and at all pot positions, in case I need to swap out resistor and capacitor values.

-I'm going to ignore taper requirements for this question (I think A and C respectively).

Here's my question:
In #1, how do I find the -3dB cutoff when the pot is turned UP and adds resistance? Or to put it another way, does adding resistance in series with the capacitor change the capacitance used for the calculation?

Oooooor is this the wrong way to think about it? Does the cutoff stay the same, but the shape of the slope changes? Meaning, frequencies HIGHER than the -3dB get cut less as the resistance goes up, but the slope still starts from the same spot, so it might not be -6dB per octave/-20dB per decade but rather something like -3dB per octave/-10dB per decade? In other words, the opposite of what a second-order filter does?
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

samhay

Top example is a shelving low pass filter with varying amount of depth - i.e. it is a voltage divider at all frequencies well above the corner frequency of ~ 600 Hz and does nothing at frequencies well below 600 Hz - i.e. essentially your alternative way of thinking about it.

Bottom example is, as you said, a low pass filter with a variable corner frequency from ~ 600 Hz to 4 kHz.

Edit - didn't really answer your question. Here is a the frequency response of a simulation of the top example. I have cut off the bottom, but you get a ~24 db cut.

I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

midwayfair

Quote from: samhay on January 14, 2015, 11:15:52 AM
Top example is a shelving low pass filter with varying amount of depth - i.e. it is a voltage divider at all frequencies well above the corner frequency of ~ 600 Hz and does nothing at frequencies well below 600 Hz.

Bottom example is, as you said, a low pass filter with a variable corner frequency from ~ 600 Hz to 4 kHz.

Okay ... so if I've got this right, then the pot in #1 is setting the lowest point that the the high frequencies will ever be cut: At max on the pot, they are down only 15%, and at minimum on the pot it's a full -6dB/octave high pass, and at, say, 25K on the pot, no frequencies are down more than 50%? Is there a handy way to find there the slope stops, um, sloping at any given resistance?
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

anotherjim

Might be easy just to look at spot frequency impedance for a given C, and use that to work voltage divider calculation.
That said, I have a cap impedance at spot frequencies chart in a handbook somewhere, but I can't find one on the web.

ashcat_lt

#4
I'm pretty sure it that the "bottom cutoff" is calculated with the source resistance and the ground leg resistor (the VR in this case) in series as R, more or less as though you're taking the output of the filter from the junction of the cap and that ground leg R and the "top cutoff" - where it shelves off - is calculated by shorting the ground leg resistor.  Note that it actually doesn't matter which comes first - the cap can be on the other side of the pot in this case and it works exactly the same.

Edit - IDK if you're at all interested in this way of conceptualizing it, but I found that the shelving filter here works out to be exactly the same as mixing the low-passed signal with the flat signal through the resistors.  When I do it in code, I figure the cutoff of the LPF as though the ground leg resistor is shorted, then filter a copy of the signal.  
I multiply the unfiltered signal by the factor indicated by the divider as you see it (0.87 with the pot at max, 0 at min)
multiply the filtered signal by the factor indicated if you look at the divider upside down...er... 1 - divratio... (0.13 -> 1)
then I add the results together.  

It would work exactly the same if you had a decently buffered LPF mixing with a decently buffered dry signal through those resistors.  
/Edit

This is the standard way to do a guitar's tone control, but that is complicated very much by the inductance of the pickup coil and acts quite a bit differently over most of the range of the knob.

duck_arse

Quote from: anotherjim on January 14, 2015, 02:58:45 PM
Might be easy just to look at spot frequency impedance for a given C, and use that to work voltage divider calculation.
That said, I have a cap impedance at spot frequencies chart in a handbook somewhere, but I can't find one on the web.


http://www.diystompboxes.com/smfforum/index.php?topic=109673.0
" I will say no more "

midwayfair

Quote from: duck_arse on January 15, 2015, 10:10:02 AM
Quote from: anotherjim on January 14, 2015, 02:58:45 PM
Might be easy just to look at spot frequency impedance for a given C, and use that to work voltage divider calculation.
That said, I have a cap impedance at spot frequencies chart in a handbook somewhere, but I can't find one on the web.


http://www.diystompboxes.com/smfforum/index.php?topic=109673.0

I think the snippet PRR posted is just a way to flip the RC filter equation, though, not to determine the attenuation of a shelf.

ash_cat's edit, which I just saw, might be the easiest way for me to think of this. I also realized that I was used to seeing shelves when dealing with source/emitter/cathode bypass capacitors, so flipping the entire graph made it easier for me to understand, even if it doesn't get me the same numbers.
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

ashcat_lt

For something like a TS gain stage, the whole thing is pretty much literally upside down!  Make it into an HPF (original - LPF), then multiply the things by the reciprocal of the factors we talked about above.  Yes, this can head toward infinity!  It will stop at the opamp's open-loop gain, but most of the time there's a fixed resistor on the ground leg to set a top limit.  After you've mixed the two together, though, you have to multiply the whole thing so that shelf itself sits at unity.  Rat is the same, except tha a)the "source resistor" is the VR, with the ground leg fixed 2) there's two filters in parallel, so you do it twice and mix the results.

I don't work with transistors much, but I think the bypass caps you're talking about work much the same as the opamp thing.  Not quite exact, but close.

Anyway, it seems like you still don't feel like you've gotten the simple answer you were looking for.  I think the basic question of how to calculate the frequencies where it turns over at top and bottom, and where the shelf sits have been answered (except I had the cutoffs swapped, will edit to fix), but if not...

Does this answer all of your questions?:

midwayfair

Quote from: ashcat_lt on January 15, 2015, 11:25:13 AM
Anyway, it seems like you still don't feel like you've gotten the simple answer you were looking for.  I think the basic question of how to calculate the frequencies where it turns over at top and bottom, and where the shelf sits have been answered (except I had the cutoffs swapped, will edit to fix), but if not...


The diagrams are super helpful, and that fully answers my question, thank you. :) Would you mind if I linked to it in the future? I think a lot of people would find it helpful when designing filters.
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

ashcat_lt

It ain't mine, dude!  I hope it's okay to post it like I did.  Probably should make it a link, I suppose.  Comes from Linkwitz Lab.