What's the deal with RC filters? When they stop being effective?

Started by nonost, May 09, 2023, 12:18:03 PM

Previous topic - Next topic

nonost

Hi. I tend to use RC filters to clean the V+ of my circuits. A 47r + 100uf  is a good start point. I take into account the current draw, so I don't lose more than a few hundreds of mV. Up to 500mV it's ok I think.

First order filters have a -6db gain per octave starting at the fc (which is at -3db). The thing is, where RC filters stop this slope and begin to "not filter" that well?

I know there's a point when they start to behave poorly. But where? It depends on numbers of the decades from the fc or it's a well-known value as 400khz?¿

I can't find the right words to get good results when searching online.

Cheers!

Ripthorn

The frequency where they stop being effective has more to do with the non-ideal nature of real world components. For example, the capacitor has an equivalent series resistance and inductance and the resistor has thermal noise that will eventually dominate the output signal from the RC filter with a high enough input frequency. The real question is "how much attenuation do you really need and at which frequencies?"
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

r080

That also gets to how the end product is used/connected. A pedalboard with an isolated power supply going to an overdrive pedal is a very different situation from an unregulated power supply going to the same overdrive pedal and a bunch of digital pedals. You can decide which situation you are building for.

Here is some info on nonlinearities:
https://article.murata.com/en-us/article/impedance-esr-frequency-characteristics-in-capacitors
Rob

Fancy Lime

+1 to what Rob said, especially the link. The TLDR is: there is a parasitic resistor in series with the cap. In practice, this on usually only relevant for large electrolytics, where this R can be tens of Ohms. A simple way to solve this issue (in those cases where it actually is an issue at all), is to install a 100nF or so film or high quality ceramic cap in parallel with the electrolytic. This provides a very low total impedance to ground well into the MHz region, which is good enough for pretty much all audio applications.

HTH,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

antonis

Quote from: nonost on May 09, 2023, 12:18:03 PM
I know there's a point when they start to behave poorly. But where?

It strongly depends on main reservoir capacitor(s) existence.. :icon_wink:
(of properly calculated capacitance, of course..)
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Rob Strand

The cap impedance and ESR depend on the value of the cap.



A 100uF cap might have an ESR in the order of 0.1 ohm to 1 ohm with a tendency to be on the lower end.

The general characteristic is the bigger the cap the lower the impedance.   So that means better filtering.

At some point the self inductance of the cap resonates with the capacitor value itself and that cause the impedance to rise (the inductive impedance, which increases with frequency, takes over).    The frequency when that occurs increases with decreasing capacitance value.    That frequency is where the cap no longer functions.  However, if you look at the impedance of a 1uF cap and a 100uF cap the impedance of the 100uF is still lower than the 1uF cap well over the resonant frequency.

The cap inductance is in the order of 25nH to 75nH so with this order of inductance long traces can make it worse.   it's easy to make things worse than the cap with bad layout.  For maximum attenuation you need to take filter output right across the cap on both terminals.

This type of plot makes it easier to see,



For an RC filter with a non-ideal cap the low-pass attenuation filter shelves to ESR / (Rs + ESR) where Rs is the filter series resistance and ESR is the cap ESR.   With a low valued series resistor like 47 ohm and a high ESR of 1 ohm the shelf is 1/48=0.021 (-34dB) whereas a lower ESR of 0.1 ohm gives an attenuation of 0.1/47.1=0.0021 (-53dB).  So the specific cap ESR has an effect.   The inductive effect will make those attenuations worse at high frequencies.

As the plot show the MLCC caps have lower inductance and lower ESR.   This is where different *types* of caps help.   The inductance is very much determined from the physical size of the cap (and of course the lead length).


When you have current pulses on the circuit side of the filter the ESR and inductance have an impact.  The way the cap filters the current pulses is different to the RC filter but it still does depend on the ESR and inductance.     Also the inductance of the power wires will add a *lot* more inductance than the cap itself, which will decrease the resonant frequency and raises the impedance.   This is why you need local filter caps near circuits with high current pulses.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

Quote from: Fancy Lime on May 09, 2023, 02:10:02 PM
A simple way to solve this issue (in those cases where it actually is an issue at all), is to install a 100nF or so film or high quality ceramic cap in parallel with the electrolytic.

+1 to this. It's a very simple and cheap way to make sure that a big filter cap is going to effectively deal with high frequency digital noise too. Definitely good practice.



nonost

I'm back! Thank you all for the help. It was a bit so much at the moment and I kinda overloaded myself.

I get the idea, although I'd like to understand it better. I'm really interested in what Rob said:

QuoteFor an RC filter with a non-ideal cap the low-pass attenuation filter shelves to ESR / (Rs + ESR) where Rs is the filter series resistance and ESR is the cap ESR.  With a low valued series resistor like 47 ohm and a high ESR of 1 ohm the shelf is 1/48=0.021 (-34dB) whereas a lower ESR of 0.1 ohm gives an attenuation of 0.1/47.1=0.0021 (-53dB).  So the specific cap ESR has an effect.  The inductive effect will make those attenuations worse at high frequencies.

Does it mean that at that specific db point, the filter starts to lose attenuation? Also, how the 0.0021 becomes -53db? I'm lost about the maths involved here.

Let's say I have a RC filter: 47r & 100uF cap. The cap is a good one and has an ESR of 0.1ohm. The -53db is at 16khz and the fcut is 33hz.



(the fcut of this website is not working good, forget about it, it's no the deal here)

Well, 16khz is quite low...

Now, we add a 100nf MLCC in parallel with a ESR of 0.010ohm. The cutoff is 33khz and the shelf let's say is something around 68db (I'm making this up), so 99Mhz.



With that configuration there is poor attenuation beyond the 16khz, and only near the Mhz region the small cap starts to make a good job. Am I missing something or that's it how things work?

Cheers!

Dormammu

The purpose of power filters is different from that of frequency filters. Don't mess them or their purposes.

ElectricDruid

Quote from: nonost on March 27, 2024, 09:23:22 PMAlso, how the 0.0021 becomes -53db? I'm lost about the maths involved here.
This bit is simple. You can easily convert from gain to dB:

dB = 20 x Log10(gain)

Gain is Vout/Vin. So x10 gain is +20dB, x2 gain is +6dB.

Or go here:
http://www.muzique.com/schem/gain.htm

Mark Hammer

RC combos on the supply input to a circuit serves two functions.  One is certainly to smooth out any ripple or momentary disturbances in the supply.  But a second function is to provide a sort of "backup battery" for the circuit, in the event of dips in the supply voltage/current.  That's why such RC combos tend to use electros of the values they do (often 47-220uf).  Cut the power to the pedal while engaged, and you'll likely see that the status LED lingers for a bit, rather than going out instantly.  For those brief instants it is powered by whatever is still stored in that electro.

R.G.

For a quick and dirty understanding of a series-R, shunt-C filter at low frequencies, do the following thought experiment.

Replace the capacitor in your mind or on a paper sketch with a resistor equal to the real cap's ESR and a switch in series with it. At frequencies so low that the capacitor's impedance is much higher than the series-R in the filter, leave the switch open. At frequencies high enough that the capacitor's impedance is lower than it's ESR, close the switch.
Those are the frequencies of the start and end of the capacitor's filtering. [technically, they're not, they're the "half-power" points where the cap is eating half the power through the network; this is the "dirty" part]
The frequency points are Flow = 1 / (2 * pi * Rseries * C) and Fhi = 1/ (2 * pi * ESR * C).
The quick and dirty approach ignores the series inductance, because for audio purposes (below 20kHz) you never get to frequencies where the inductance matters, at least with most modern capacitors. This is NOT true if you're doing RF.
Capacitors separate into two crude categories for filtering: big and small. Big = electrolytic, small = not electrolytic. As a crude approximation, big/electrolytics have enough ESL and ESR to worry about in audio, small/non-electrolytics do not. Big/electrolytics are used to filter or smooth power suppl noise. They can technically be used for audio/tone filtering, but it's not a good idea to do so, because electros also decay and change in value, so your carefully calculated filter frequencies start wandering all over. Electros should be use where the only criteria for filtering is "big enough". Non-electros should be used for frequencies where you want a stable filter turnover point, and for filtering high frequencies to keep oscillation from happening.

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.

antonis

Well said Mark.. :icon_wink:

Just a clarification:

Quote from: Mark Hammer on March 28, 2024, 08:01:18 AMa second function is to provide a sort of "backup battery" for the circuit, in the event of dips in the supply voltage/current.

That will work only in case of dip caused by load (powered circuit)..
In case of power supply caused dip, it couldn't help much..
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

amptramp

In the olden days, a lot of electrolytic capacitors were specified with a tolerance of +100%/-20% so if you had a 50 µF cap, it could be anywhere from 40 µF to 100 µF and for power filter applications, this may have been perfectly OK.  If you were making audio filters, this would be totally unacceptable.  A lot of solid-state stereos that use a lot of electrolytics sound unbalanced channel-to-channel because of the huge variations in value.

(And yes, I am from the olden days.  I hold the patent on dirt.  I grew up on wooly mammoth steaks and pterodactyl wings.  I remember vacuum tubes with coal-fired cathodes.  I still design with pencil and paper because CAD systems are so annoying.)

nonost

I came up with this. For circuits with a dual opamp, which are very common, it drops around 0.5v across the 47r, so basically fine in most scenarios. Of course it can be tweaked for other use cases but you have to take into account the stuff talked along this post.



A you can see it has plenty of attenuation. The cap is top. I've read somewhere that SMPS don't usually like big caps at their output. Hopefully the 330uF will do the job.

For guitar pedals is overkill. I know. I'm using this for a more hifi little circuit.

Thank you all. You've made a great post with all your contributions.

This was really helpful R.G.

QuoteReplace the capacitor in your mind or on a paper sketch with a resistor equal to the real cap's ESR and a switch in series with it. At frequencies so low that the capacitor's impedance is much higher than the series-R in the filter, leave the switch open. At frequencies high enough that the capacitor's impedance is lower than it's ESR, close the switch.

nonost

I thought that is better to use a film cap for the 1uF cap. MLCC in the 1uF range are not the best ones. They lose capacitance when voltage applied and it throws the calculations out of the window. So yeah, a 1uf-4.7uf film cap would be better.

A doubt comes to my mind... In the filter posted above (47r + 330uF electro + 1uF MLCC), the electro gives -70db at 33khz and at the same frequency the 1uf cap gives -20db. Does it mean that the whole filter attenuates -90db at 33khz? I mean, is it right to add both numbers (70 + 20 = 90) ?

Cheers!

R.G.

Quote from: nonost on April 04, 2024, 07:27:14 AMI thought that is better to use a film cap for the 1uF cap. MLCC in the 1uF range are not the best ones. They lose capacitance when voltage applied and it throws the calculations out of the window. So yeah, a 1uf-4.7uf film cap would be better.
In MLCCs, the capacitance does change with voltage and temperature. However, the specific type of ceramic then matters. Ceramic caps have a three-letter insulator type to classify them. Types "C0G" or "NPO" are very, very stable. Types X7R and X5R will vary no more than +/- 15% over a -55 to +125C temperature range. Other types can be worse. Try reading https://en.wikipedia.org/wiki/Ceramic_capacitor for more details.
It's not accurate to say all MLCCs are poor. And the professionals do use them for filtering, especially power supply filtering.

QuoteA doubt comes to my mind... In the filter posted above (47r + 330uF electro + 1uF MLCC), the electro gives -70db at 33khz and at the same frequency the 1uf cap gives -20db. Does it mean that the whole filter attenuates -90db at 33khz? I mean, is it right to add both numbers (70 + 20 = 90) ?
No, it doesn't mean that you can simply add the attenuations.

If you have a 330uF electro, and parallel it with a 1uf MLCC, the pair acts like a 331uF capacitor at low frequencies. It only departs from this when the self-inductance and ESR of the electrolytic parts of the electro cause it to not keep decreasing in impedance as frequency rises. Then the 1uF MLCC takes over and the combined impedance keeps decreasing as frequency goes up.
If you don't know the ESR and self inductance of the electrolytic capacitor, you can't accurately predict exactly what frequency will start changing over to the MLCC being the main filtering.
Electrolytics act like there is an ideal capacitor with a small resistor and a small inductor in series with them, but inside the capacitor package where you can't remove them.
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.

PRR

Quote from: nonost on April 04, 2024, 07:27:14 AMA doubt comes to my mind... In the filter posted above (47r + 330uF electro + 1uF MLCC), the electro gives -70db at 33khz and at the same frequency the 1uf cap gives -20db. Does it mean that the whole filter attenuates -90db at 33khz? I mean, is it right to add both numbers (70 + 20 = 90) ?

In a real world, and single-stage filters, you rarely do better than 30 or 40dB (in the audio band) because of stray parasitics in wiring and PCB traces. Maybe 50dB, but any time the figures say even 60dB don't believe it.

You can build and test, but measuring 60dB loss a few inches apart is tricky.
  • SUPPORTER

m4268588


nonost

Well, what I said was:

QuoteMLCC in the 1uF range are not the best ones.

And I keep it. It's even more true in this context of DIY pedals where many of us don't buy from big companies. Not all web sites provides 1uF values, and in the best case they are Z5U type. This type it's no the best MLCC, actually it's among the worst. Of course regarding capacitance drift under voltage. Good 1uF ones are not that easy to find in small package.

I find it hard to the ESL numbers from caps. Plenty of datasheets don't even show you the ESR.

So, this is snake oil(?):



It looks too good to be true to be honest... The graphic tells that once frequencies reach the 0 point, attenuation is no longer improving but stays at the peak value. Which is something huge.

This is for a 5r6 + 33uF (37 ESR)



Thank you all! :)