How to Design an RC Low-Pass Filter and Simulate It with SPICE

📅
✍️ By CircuPilot Team
← Back to Blog Hub

How to Design an RC Low-Pass Filter and Simulate It with SPICE

Filtering signals is one of the most fundamental operations in electronics. Whether you are removing high-frequency noise from a sensor reading, smoothing the output of a power supply, or shaping audio signals, an RC low-pass filter is often the simplest and most effective tool for the job.

In this evergreen engineering guide, we’ll cover everything from the basic physics of RC filters to designing one yourself, calculating its critical cutoff frequency, writing a SPICE netlist, and simulating it inside your browser to view the frequency response.

---

What Is an RC Low-Pass Filter?

An RC low-pass filter is a simple analog circuit made of a single resistor (R) and capacitor (C) that allows low-frequency signals to pass through easily while attenuating (weakening) signals with frequencies higher than a predetermined threshold.

High-frequency signals (like electromagnetic interference, radio hum, or digital switching noise) are shunted to ground, leaving a cleaner, smoother low-frequency output.

---

How the RC Filter Works

The magic of the RC low-pass filter lies in the physical property of the capacitor known as capacitive reactance ($X_C$). Reactance is the capacitor’s equivalent of resistance to AC (alternating current) signals, and it is calculated as:

\[X_C = \frac{1}{2 \pi f C}\]

Where:

  • $f$ is the frequency of the AC signal in Hertz (Hz).
  • $C$ is the capacitance in Farads (F).

Looking at the formula, you can see that capacitive reactance is inversely proportional to frequency:

  • At low frequencies (small $f$), $X_C$ is very large (acts like an open circuit). The voltage drop across the capacitor is high, so most of the input voltage appears at the output node.
  • At high frequencies (large $f$), $X_C$ becomes very small (acts like a short circuit). The capacitor shunts the high-frequency signal straight to ground, making the output voltage close to zero.

---

Calculating the Cutoff Frequency

The boundary between "allowed" low frequencies and "attenuated" high frequencies is called the cutoff frequency ($f_c$), also known as the $-3\text{dB}$ point or corner frequency. At this specific frequency, the output power drops to 50% (and output voltage drops to about 70.7% of the input voltage).

The formula for calculating the cutoff frequency of an RC filter is:

\[f_c = \frac{1}{2 \pi R C}\]

Where:

  • $f_c$ is the cutoff frequency in Hz.
  • $R$ is the resistance in Ohms ($\Omega$).
  • $C$ is the capacitance in Farads (F).

---

Choosing R and C Values

When designing an RC filter, you typically start with a target cutoff frequency $f_c$. You then select standard, commercially available component values for $R$ and $C$ to match that target.

Let's say we want to design a filter for an audio preamp to block high-frequency hum above 1.59 kHz:

1. Let's choose a standard capacitor value first, say $C = 100\text{nF}$ ($100 \times 10^{-9}\text{F}$).

2. We rearrange our cutoff frequency formula to solve for resistance:

\[R = \frac{1}{2 \pi f_c C}\]

3. Plug in our target values:

\[R = \frac{1}{2 \pi \times 1590 \times (100 \times 10^{-9})} \approx 1000\ \Omega \text{ (or } 1\text{k}\Omega\text{)}\]

Our component choices are: R = 1kΩ and C = 100nF.

---

Writing the SPICE Netlist

Now that we have chosen our components, we can write a SPICE netlist to analyze the frequency response of our filter. We will use an AC Analysis to sweep the input signal across a range of frequencies (from 10 Hz to 100 kHz) and plot the gain (in decibels) and phase.

Here is the complete SPICE netlist for our audio filter:

* RC Low-Pass Filter AC Sweep
V1 In 0 AC 1
R1 In Out 1k
C1 Out 0 100n
.ac dec 10 10 100k
.end

Deconstructing the Code:

  • V1 In 0 AC 1: An AC voltage source connected between input node In and ground node 0 with an amplitude of 1V.
  • R1 In Out 1k: A 1kΩ resistor between input node In and output node Out.
  • C1 Out 0 100n: A 100nF capacitor between output node Out and ground node 0.
  • .ac dec 10 10 100k: Instructs the SPICE engine to perform an AC analysis. dec means decades-based sweep, 10 is the number of points per decade, 10 is the start frequency (10 Hz), and 100k is the stop frequency (100 kHz).

---

Running an AC Analysis and Reading the Frequency Response

When you run this simulation inside a SPICE engine (like ngspice or CircuPilot's built-in simulator), you will get two key plots: the magnitude (amplitude) response and the phase response. Together, these form a Bode Plot.

  • At frequencies far below 1.59 kHz: The magnitude is $0\text{dB}$ (gain of 1, meaning input voltage equals output voltage) and the phase shift is $0^\circ$.
  • At the cutoff frequency (1.59 kHz): The magnitude is exactly $-3\text{dB}$ (the voltage drops to 0.707V) and the phase shift is exactly $-45^\circ$.
  • At frequencies far above 1.59 kHz: The magnitude rolls off at a rate of -20dB per decade (meaning every tenfold increase in frequency reduces the output signal by 90%).

---

Common RC Filter Design Mistakes

1. Ignoring Source and Load Impedance: An RC filter does not exist in a vacuum. If the circuit driving the filter has a high output impedance, or the circuit receiving the filtered signal has a low input impedance, it will change the effective resistance of your filter and shift the cutoff frequency.

2. Selecting Impractically Small R or C Values: Choosing a very small resistor (e.g., $10\Omega$) might require the driving circuit to supply too much current, causing distortion. Conversely, choosing an extremely large resistor (e.g., $10\text{M}\Omega$) makes the circuit highly susceptible to thermal noise and stray capacitance.

3. Ignoring Capacitor Material: In high-precision analog filtering, ceramic disk capacitors can experience capacitance drift with changes in DC voltage. Film or NP0/C0G ceramic capacitors are highly recommended for stable filters.

---

How AI Can Help Design the Circuit

Using modern AI tools like CircuPilot, you don't need to manually lookup formulas and calculate values yourself. You can simply prompt the assistant with your target goals, such as:

> "Design a low pass filter with a cutoff frequency of 5kHz and write the SPICE netlist for it."

The AI will calculate the ideal resistor and capacitor values, choose standard E24 series components, and generate the schema for you instantly on the canvas.

Try the Circuit in CircuPilot

Ready to visualize this circuit in action? Open CircuPilot right now and drag a voltage source, a resistor, and a capacitor onto the workspace. You can simulate and tweak the values on the fly to see how the corner frequency shifts in real-time!