capacitors and frequency

Started by Ashurbanipal, June 07, 2006, 01:22:53 PM

Previous topic - Next topic

Ashurbanipal

I've noticed that the same value cap used in different contexts affects frequency differently. Anybody know why?

Like wahs and some tone control circuits have a pot to change frequency, but the cap isn't changing, it's resistance. Or a .22uf cap in a coupling position after the input doesn't affect bass much, but when going to ground from the feedback loop of an opamp in an effect I built, it was sucking bass, so I changed to 10uF to get the bass response back.

Why does this work this way?

R.G.

Good beginner's question.

The frequency response of a capacitor is not fixed, but varies with the parts around it.

A capacitor "impedes" different frequencies by different amounts. The actual amount that a capacitor impedes current flow with frequency is

Xc = 1/(2*pi*F*C)

where pi = 3.14159...., F is the frequency, and C is the capacitance in Farads. So at a specific frequency, a capacitor will only let a current flow that is

I = V/Xc or I = V*(2*pi*F*C)

which shows that the bigger the capacitor or the higher the frequency, the more current that flows.

When you combine that with an external resistor, you get the frequency rolloff effects.

If you have a signal source, a series resistor, then a capacitor to ground, the voltage at the junction of the resistor and cap will be divided by the voltage divider rule. So

Vout = Vin* (Xc/(R+Xc))

At very low frequencies, Xc is much, much bigger than R, and so the voltage out is just the voltage in. At very high frequencies, Xc is much less than R, and the voltage out is tiny, being "shorted out" by Xc.

In the middle, the output voltage is controlled by the ratio of R and Xc. EE's take the point where the C takes over as the biggest effect as the frequency where R = Xc, or

F = 1/(2*pi*R*C)

Notice that if you have a different R, then it changes the rolloff point. So for the cap capacitor, the rolloff frequency may be ANYTHING depending on the R around it.

The same reasoning applie if the capacitor is first in series, then the R to ground. But in that configuration, you get a high pass filter, not a lowpass as I did in the example.

There is no specific frequency to a capacitor. There's only a rolloff frequency when you take into account the other stuff around it.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Ashurbanipal

Thanks for the thorough yet not-overly complicated explanation.

So what happens when a cap and resistor are in parallel? Does it change the rolloff slope or the frequence cuttoff?

Seljer

I think when you have them in parallel you get some kind of phase shift thing going on?

InFlame00

I just wan't to ask a question kinda related to this to see if I gotten this right...

The tonepot inside a guitar is wired with one of the legs connected to ground via a cap. And the output from the volumepots enter the input of the tonepot's other leg, the third leg isn't used on a tonepot, right?
Now the question...a cap let higher Hz flow through it when the current is high, right? And when the tonepot is at 0, the current will be at max and the high Hz will flow though the cap and then end up in the grounding, as you turn the toneknob, the current will be lower and the cap will cut thoose high Hz and instead for going to the ground it will go stright to the output of the guitar?
The point about asking this question is that a cap will regulate how high Hz it will let pass though depending on the current?

Mark Hammer

Imagine you're at the bank.  There is a general lineup, and tellers serve people as they come off the front of the line.  If you were to try and do a banking transaction, and then go to the back of the line and attempt another transaction, how often could you do that in an hour?  Well, it would depend on both the number of tellers there were at the counter, and the length of the lineup.  If the lineup is long but there are 10 tellers, you can just keep zipping through there, going to the back of the line and advancing through the line at a rapid clip.  If there is only one teller on duty, even a lineup of modest length will require you to wait a while.

Now, tellers aren't capacitors, and lineups aren't resistors, but the general notion that the outcome depends on the relative limits set by two interacting components remains the same.

Capacitors store charge, but the rate at which the charge is stored (and amount of charge stored after some defined period of time) will depend on the resistance imposed.  Inthis sense, I guess lineups ARE like resistors in that they impede the "flow" of customers/ions.

When caps and resistors are in parallel, other principles come into play.  Capacitors play a role much like frequency-dependent resistors.  As the frequency of the signal increases, the capacitor imposes less resistance to that signal.  Conversely, lower frequencies face what amounts to a higher resistance when attempting to pass through a capacitor.  If you were a bit of current at a given frequency and you were faced with two possible paths to traverse, one a capacitor, and the other a resistor, which would you take?  That would depend on what frequency you were, what the resistance value was, and what the capacitance value was.  In some instances, the resistor provides an easier path for that signal to pass through because, for that frequency, the capacitor presents a much greater obstacle than the resistor does.  If the frequency was higher, however, that capacitor might well present less of an impediment to the signal than the resistor does.

Niow imagine we increase the value of the resistor.  While the relative difficulty of passing through for different frequencies remains the same (after all, the cap will not change its frequency-sensitive behaviour), compared to the resistor even LOW frequencies find it easier to pass through the cap than the resistor.

Here is an example in action.  It is common to find a "compensating cap" on the volume control of a fender guitar.  What does it do?  Consider that the volume pot is essentially two changing resistors, connected at the wiper or centre lug.  The compensating cap joins the wiper and input.  It is a cap in parallel with a to-be-determined resistance, just like in our example above.  When the volume pot is turned up full, the resistance between the wiper and input is zero ohms; pretty easy for all frequencies to pass through.  As the volume gets turned down, though, what happens?  We have increased the resistance in our parallel resistor/capacitor combo.  At a certain point, it now starts to become easier for some frequencies to pass through the cap - like it was a special V.I.P. gate for high frequencies to avoid lineups - than to pass through the resistor (remember, the cap is like a resistor whose value changes with input signal frequency).  As the resistance of that leg of the pot gets higher, the cap provides even more of an advantage to higher frequencies.  Of course, since the cap is a small value, the disadvantage for lower frequencies will still exist, and the cap will not offer any advantage relative to the resistor path.

So, by this means, the compensating cap provides a way to provide some advantage to high end as one turns down.  It is called a "compensating" cap for 2 reasons:  1) It is the nature of human hearing that we don't hear treble quite as well at lower volumes so the little "boost" (savings actually) compensates for our hearing, 2) As the volume pot is turned down, there is a loading effect and some treble loss occurs for electronic reasons, so it compensates for that too.

Clear?  Not a spec of math in there either. :icon_wink:

InFlame00

I still can't get why there are only 2 wires connected to the tonepot, one to the ground via a cap and one just connected to the output of the volumepots...maby i'm to tired right now but can anyone try to explane this? :(

Spacedementia87

i would just like to point out that your formula for the impedance of a capacitor isn't quite right.


it is infact a complex impeder:

so infact

Z = 1/(i*w*C)

Z is the impedance, i is root of -1, and w is the angular frequency or 2*pi*f

It makes the maths alot easier to think of the impedance like this and the current to be of the form

I(t) = I0exp(iwt)

InFlame00

Quote from: Spacedementia87 on June 08, 2006, 04:53:22 PM
i would just like to point out that your formula for the impedance of a capacitor isn't quite right.


it is infact a complex impeder:

so infact

Z = 1/(i*w*C)

Z is the impedance, i is root of -1, and w is the angular frequency or 2*pi*f

It makes the maths alot easier to think of the impedance like this and the current to be of the form

I(t) = I0exp(iwt)


I used to know all thoose laws even when someone woke me up in the middle of the night and asked me. But that was in school. Now I work as a ordinary electrician and we don't have any use for thoose laws anymore. Thats too bad actually :\

Mark Hammer

Quote from: InFlame00 on June 08, 2006, 04:44:38 PM
I still can't get why there are only 2 wires connected to the tonepot, one to the ground via a cap and one just connected to the output of the volumepots...maby i'm to tired right now but can anyone try to explane this? :(
You MUST be tired.  Your spelling is shot to hell.  :icon_wink:
The tone control is one of two paths the signal can proceed along: it can follow the volume pot or it can follow the tone control.    Imagine a conveyor belt for sorting apples or oranges or some other fruit.  The fruit moves along, and it if is smaller than a certain hole size, it falls through into a collector bin.  If bigger than that size, it keeps going.  Imagine it was possible to systematically vary the number of holes of that size.  As the belt moves along you could vary the number of oranges, etc. you collect from more to less or vice versa.

The tone cap bleeds treble content to ground by providing a low resistance path for certain frequencies.  Just like our oranges, once they hit the spot where they can pass through the holes and are collected, they don't go any farther than that.  Of course, just like our oranges, if we closed up all the holes, all the oranges would move along the conveyor belt without losing any.  The tone pot varies the resistance leading to the cap so that greater and lesser amount of treble in the same range can escape to ground via the cap.

This is why I advocate the "bidirectional tone control" that uses two different caps, one on each end.  Since the cap sets the range of content which can pass through (bleed) to ground, using two alternate tone caps lets you bleed off varying amounts above THIS frequency while keeping stuff below it, and the other cap lets you bleed off stuff in varying amounts down to a LOWER frequency.  Not quite a 7-band EQ, but flexible.

Ashurbanipal

Quotei would just like to point out that your formula for the impedance of a capacitor isn't quite right.

Uh-oh, Now I'm tempted to stick with my current practice of "If it sounds good, go with it".

So, what happens when a cap and resistor are in parallel?

InFlame00

Quote from: Mark Hammer on June 08, 2006, 05:04:37 PM
Quote from: InFlame00 on June 08, 2006, 04:44:38 PM
I still can't get why there are only 2 wires connected to the tonepot, one to the ground via a cap and one just connected to the output of the volumepots...maby i'm to tired right now but can anyone try to explane this? :(
You MUST be tired.  Your spelling is shot to hell.  :icon_wink:
The tone control is one of two paths the signal can proceed along: it can follow the volume pot or it can follow the tone control.    Imagine a conveyor belt for sorting apples or oranges or some other fruit.  The fruit moves along, and it if is smaller than a certain hole size, it falls through into a collector bin.  If bigger than that size, it keeps going.  Imagine it was possible to systematically vary the number of holes of that size.  As the belt moves along you could vary the number of oranges, etc. you collect from more to less or vice versa.

The tone cap bleeds treble content to ground by providing a low resistance path for certain frequencies.  Just like our oranges, once they hit the spot where they can pass through the holes and are collected, they don't go any farther than that.  Of course, just like our oranges, if we closed up all the holes, all the oranges would move along the conveyor belt without losing any.  The tone pot varies the resistance leading to the cap so that greater and lesser amount of treble in the same range can escape to ground via the cap.

This is why I advocate the "bidirectional tone control" that uses two different caps, one on each end.  Since the cap sets the range of content which can pass through (bleed) to ground, using two alternate tone caps lets you bleed off varying amounts above THIS frequency while keeping stuff below it, and the other cap lets you bleed off stuff in varying amounts down to a LOWER frequency.  Not quite a 7-band EQ, but flexible.

But in that case, a tone pot must be inverted compared to a volume pot? Because if I turn on my volumeknobs just alittle and then turn the tone all the way up. the sound get much higher (in db)

Spacedementia87

Everything else that is said was right.

When a cap and resistor are in parallel the total impedance ads up in recipricals

so

1/Z = 1/R + iwC

But by what it does it depends.

if that is all you have in your circuit.

so +ve terminal ---> (cap resistor parallel) -----> -ve terminal

it won't do much at all

R.G.

Quote from: AshurbanipalSo what happens when a cap and resistor are in parallel? Does it change the rolloff slope or the frequence cuttoff?
Let's see if we can reason it out.

The pair in parallel act much like two resistors in parallel, one the real resistor and one the capacitive impedance.

So at very low frequencies, the capacitor's impedance is very high, and any impressed signal sees only the resistor. At very high frequencies, the capacitor's impedance is very low, so only capacitor matters because it's so much lower impedance than the resistors. The frequency where it changes over? Yep, where they're equal, and that's identical to the frequency for the series combinations, F= 1/2*pi*R*C.

Notice that if you drive a parallel combination with a current source, the voltage across the parallel combination of RC is just V = Isource*R from DC up to near the turnover frequency. Above the turnover, you get the capacitor eating the current, and the voltage declining at -20db/decade.

A single RC circuit always has a turnover frequency of 1/2*pi*R*C, and a 6db/octave slope after the turnover. How you arrange the R and C is what determines whether it's a highpass or lowpass.

Quote from: Spacedementia87i would just like to point out that your formula for the impedance of a capacitor isn't quite right.
it is infact a complex impeder:
Oh, it's right enough. It's just not exhaustively complete, and intentionally so.

It is indeed a complex quantity. An my formula for the impedance is correct for the magnitude of the capcitive impedance, but not the phase.

I judged that a beginner who does not yet understand capacitors and resistors at all and seems not to have a lot of math would be able to comprehend the basics of capacitors better without the complication of complex algebra yet. In fact, for about 99% of everything that needs done here, the simple magnitude version works OK. It runs out of gas when you have to explain phase shifters or phase shift oscillators.

QuoteIt makes the maths alot easier to think of the impedance like this and the current to be of the form I(t) = I0exp(iwt)
It sure does - if you've had enough math to know what I(t)=I0exp(iwt) means. Many people don't.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

davebungo

Quote from: R.G. on June 07, 2006, 01:40:55 PM
Vout = Vin* (Xc/(R+Xc))
This is incorrect although it does illustrate the principle of how a low pass filter works, and the calculation works for frequencies significantly below and beyond the roll-off frequency or 3dB point so I would say it's a fair enough calculation to use.

The only problems arise around the 3dB point (i.e. at f = 1/2*PI*C*R) or so called cut-off frequency (although people should not interpret this as some kind of magical point after which you get no signal - it is just the point after which the roll off really starts in earnest)

If we had a 1Mohm resistor and a 1uF cap (not a very practical combination but convenient for calculation) and if we assume a signal of 0.159Hz:

Xc = 1/(2*PI*0.159*1uF) = a reactance of 1Meg.  OK so far.

So we want to know the magnitude of the voltage at the output at the given frequency so we use the stated rule:
Xc/(R+Xc) = 1Meg/(1Meg+1Meg) = 0.5 or 20*log(0.5) = 6dB attenuation - which is incorrect

The correct analysis *requires* us to consider the complex nature of the impedance of the capacitor:
Vout/Vin = 1/jwC / (R + 1/jwC) = 1/(1+jwCR) - where w (omega) = 2*PI*f radians /sec

at 0.159Hz this will be 1/(1+j1)

The magnitude of this is 1/sqrt(2) or 0.7071 or 20*log(0.7071) = 3dB attenuation.

R.G.

You are correct - it's half power, not half voltage. The voltage square root of two over two times the base.

I'll stand by my handwaving - but I should have handwaved a different number. Sorry - I was in a hurry and I don't type all that fast.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.