Skip to content
Simurq Labs

Learn

RC filter calculator

By Semih Özbir, Electrical and Electronics Engineer

Published · Last reviewed

In this guide · 6

An RC filter's cutoff frequency is fc = 1 / (2πRC) and its time constant τ = RC: 1.59 kΩ and 100 nF, an example from Microchip's note on filters before an ADC, give 1.00 kHz and 159 µs. At the cutoff the output is 3 dB down, at 0.707 of the input, and 45° out of phase.

Find
Filter

Low-pass: the output across C. High-pass: the output across R.

Cutoff frequency1.00 kHzTime constant τ = RC = 159 µs
At 10.0 kHz0.0996 (−20.0 dB), −84.3°Charged to 99 % of a step732 µs, 4.61 τ
0 dB−20−4010.0 Hz100 Hz1.00 kHz10.0 kHz100 kHz

fc = 1/(2πRC), with a single pole's gain and phase as TI's Analog Engineer's Pocket Reference gives them, and the high-pass's as Penn State's notes do. Ideal parts, with no source or load impedance.

Cutoff frequency: 1.00 kHz

This RC filter calculator finds the cutoff, the resistance or the capacitance from the other two, for an output taken across the capacitor, a low-pass, or across the resistor, a high-pass. It returns the time constant, the gain and phase at a frequency you give and how long the capacitor takes to charge to a share of a step, and draws the gain against frequency.

Where do the RC filter formulas come from?

In a low-pass, the resistor runs in series from the input to the output, and the capacitor goes from the output to ground. Microchip's application note AN699 draws it with its cutoff, in its Figure 8:

fc = 1 / (2π × R × C)

TI's Analog Engineer's Pocket Reference gives a single pole's gain and phase at a frequency f, in its equations 69 to 71. A passive RC passes a steady voltage whole, so its gain at 0 Hz is 1:

  • Gain: G = 1 / √((f / fc)² + 1)
  • In decibels: 20 × log10(G)
  • Phase: θ = −tan⁻¹(f / fc), the output lagging the input.

That is −3 dB and −45° at fc. Past it, TI's Bode plot of a pole falls 20 dB a decade, and its phase runs from 0° below a tenth of fc to −90° above ten times it.

A high-pass swaps the parts: the capacitor in series, the output across the resistor. John M. Cimbala's lecture notes on filters, from Penn State, give its gain as G = 1 / √(1 + (fc / f)²) and its phase as tan⁻¹(fc / f): the output leads, by 45° at the same cutoff.

In time, both are a capacitor charging through a resistor. TI writes its voltage after a step as VC = VS × (1 − e^(−t / τ)), with τ = RC, and counts it 99.3 % charged after five time constants. Turned round, a share p of the step takes t = −τ × ln(1 − p). The low-pass output follows the capacitor; the high-pass output is what is left of the step.

A worked example: a 1 kHz filter before an ADC

AN699 sizes a passive low-pass for 1 kHz on a 0.1 µF capacitor, and works out a 1.59 kΩ resistor for it. Its design example samples a signal of up to 1 kHz with a 12-bit ADC at 20 kHz, so half the sampling rate is 10 kHz.

  1. The resistor: R = 1 / (2π × 1,000 Hz × 100 nF) = 1,592 Ω, AN699's 1.59 kΩ.
  2. The time constant and the cutoff: τ = 1.59 kΩ × 100 nF = 159 µs, and fc = 1 / (2π × 159 µs) = 1.00 kHz.
  3. At 10 kHz: f / fc = 9.99, so G = 1 / √(9.99² + 1) = 0.0996.
  4. In decibels and degrees: 20 × log10(0.0996) = −20.0 dB, and −tan⁻¹(9.99) = −84.3°.
  5. After a step, 99 % of it: t = −159 µs × ln(1 − 0.99) = 732 µs, 4.61 time constants, or about 15 samples at 20 kHz.

So the filter passes its 1 kHz signal 3 dB down and cuts 10 kHz to a tenth. AN699 asks more of an anti-aliasing filter: at half the sampling rate, a gain at least the ADC's signal-to-noise ratio below the passband, 74 dB for an ideal 12-bit converter. One pole falls only 20 dB a decade, so 74 dB at 10 kHz would put its cutoff near 2 Hz, far below the signal. AN699 reaches 79 dB at 10 kHz with a fifth-order Bessel filter, two active stages and a passive RC, its cutoff still 1 kHz.

Chart of gain in decibels against frequency from 10 Hz to 100 kHz for 1.59 kΩ and 100 nF: the low-pass is flat up to its 1.00 kHz cutoff, 3 dB down there, then falls 20 dB a decade, to −20.0 dB at 10 kHz; the high-pass mirrors it about the cutoff.

Gain against frequency for 1.59 kΩ and 100 nF as a low-pass and a high-pass, computed from a single pole's equations in Texas Instruments' Analog Engineer's Pocket Reference and Penn State's notes.

A time constant on an enable pin

The same two parts make a delay. Espressif's ESP32-C3 starts once its enable pin, EN, is pulled high, and resets while EN is held low. Espressif's hardware design guidelines recommend an RC delay there, "usually R = 10 kΩ and C = 1 µF". The module's peripheral schematic puts the resistor from 3.3 V to EN and the capacitor from EN to ground.

That is τ = 10 kΩ × 1 µF = 10 ms, or a cutoff of 15.9 Hz. The ESP32-C3-WROOM-02 datasheet gives the voltage that releases the reset as at least 0.75 of the supply, in its Table 6-3. So on a supply that comes up at once, EN gets there after −10 ms × ln(1 − 0.75) = 13.9 ms.

Espressif's timing for EN, and what to fit where the supply rises slowly, are in our ESP32 schematic guide.

How do you choose R and C?

  • The capacitor first. AN699 and Cimbala both pick the capacitor and work out the resistor, R = 1 / (2π × fc × C). Cimbala's example takes 31.8 kΩ for 50 Hz on 0.10 µF, and passes noise at 1,000 Hz at 0.050 of its size, −26 dB.
  • The capacitor's type. TI's reference gives C0G for the signal path and filtering, from 0.1 pF to 0.47 µF at ±30 ppm/°C. It gives X7R, 10 pF to 47 µF, for decoupling and uses that need no accuracy: its capacitance moves with the voltage across it, which TI counts most in filtering. A cutoff you rely on wants C0G, so where it would take more than 0.47 µF, raise the resistor instead.
  • Tolerance. The cutoff moves with the product RC. A 1 % resistor beside a 10 % capacitor puts it anywhere from 10 % below to 12 % above its nominal. TI lists C0G at ±1 % to ±10 %, and X7R at ±5 % to −20 %/+80 %.
  • The resistor's size. The formulas take an ideal source and, as Cimbala writes, a device reading the output with infinite impedance. A passive filter's output impedance is high next to an active filter's, AN699 warns: even its 1.59 kΩ can drop a voltage into a load. It keeps passive filters to one pole, common at the input of a delta-sigma ADC, where that impedance does not upset the conversion.

What changes on a real board?

  • The ADC's sampling. Espressif asks for a 0.1 µF capacitor from each ESP32-C3 ADC pin to ground, which with whatever drives the pin, a divider for one, is an RC too. To settle a full-scale step to N bits, TI's reference counts ln(2^N) time constants: 6.93 for 10 bits, 8.32 for 12. The worked example's filter takes 8.32 × 159 µs = 1.32 ms to settle to 12 bits, about 26 samples at 20 kHz.
  • The capacitor's inductance. TI gives a capacitor 100 pH to 10 nH of series inductance. Murata puts an MLCC's own at about 0.5 nH, adds about 0.5 nH for each millimetre of track and 0.1 nH for each via in series with it, and notes that above its self-resonant frequency a capacitor is inductive. So far above the cutoff a real filter cuts less than the formula says: keep the capacitor's path to ground short.
  • Leakage. TI puts a capacitor's parallel leakage at tens of megohms for some electrolytics and tens of gigohms for ceramics. With a resistor of megohms, the two divide the voltage, and the capacitor never charges to the whole step.

Limits

The calculator is for one resistor and one capacitor, a single pole. A steeper filter, such as AN699's fifth-order design, takes more parts and other formulas. It takes both parts as ideal and exact, the source as having no impedance and the load as having infinite impedance, and leaves out the capacitor's inductance, resistance and leakage. It flags a capacitance outside 0.1 pF to 68,000 µF, the span of TI's table from its smallest C0G to its largest aluminium electrolytic. Its settling times are for one step from rest.

Every figure here is computed from the formulas or taken from the documents cited; none measured on a board. Can AI design a PCB? covers what the checks do prove.

Sources

Have a board in mind?

PCB Agent is not open to the public yet. Leave your email, and we'll write when early access starts.