In my upcoming course, Introduction to Electronics: First-order filters, you’ll explore fundamental electronics concepts through practical applications, simulations, and hands-on experimentation. The course emphasizes learning by doing, supported by clear theoretical explanations, mathematics, and the use of industry-standard lab equipment and software tools.
In this post, I want to share with you a complete lecture from the course, titled “Activity 4: Filter on a Breadboard,”presented in two parts.
Part 1: Setting up the RC high-pass filter experiment
In the first part of this lecture, I demonstrate how easy it is to build and test a simple RC high-pass filter using just two components: a capacitor and a resistor. To simplify the setup and enhance measurement accuracy, I connect the components directly without a breadboard. This method helps minimize parasitic capacitances and ensures cleaner signal measurements.
I use the Analog Discovery 3, a versatile tool for electronics education, to provide input signals, measure responses, and perform analysis. The video clearly illustrates how to set up the circuit, configure the waveform generator and oscilloscope, and perform initial measurements of amplitude attenuation and phase shift at lower frequencies.
Part 2: Frequency response analysis and Python visualization
In the second part of the lecture, I investigate how the RC filter behaves across higher frequencies. Using the Analog Discovery 3, I demonstrate measuring the signal amplitude attenuation and phase shift at frequencies above the filter’s cutoff frequency. These experiments clearly show how high-frequency signals pass through with minimal attenuation, a core characteristic of high-pass filters.
Additionally, I explore advanced capabilities of the Analog Discovery 3’s WaveForms software, particularly the Spectrum Analyzer and Network Analyzer tools. These tools allow you to visualize the spectrum of the filtered signal and experimentally plot the filter’s frequency response.
Finally, I introduce a demonstration Python script that theoretically models and visualizes the frequency response of the RC filter. This script generates plots of sine waves at different frequencies, calculates theoretical phase shifts, and provides an excellent reference point to compare experimental data.
Here is the demo script (you can copy it from Github Gists):
import numpy as np
import matplotlib.pyplot as plt
R = 2e3
C = 100e-9
fc = 1 / (2 * np.pi * R * C)
print(f"Cutoff frequency: {fc:.2f} Hz\n")
frequencies = [200, 500, 1000, 2000, 5000, 10000]
plt.figure(figsize=(10, 8))
for i, f in enumerate(frequencies):
T = 1 / f
t = np.linspace(0, 2 * T, 1000)
omega = 2 * np.pi * f
v_in = np.sin(omega * t)
H_mag = (omega * R * C) / np.sqrt(1 + (omega * R * C)**2)
phi_rad = np.arctan(1 / (omega * R * C)) # Phase shift in radians
phi_deg = np.degrees(phi_rad) # Convert to degrees
delta_t = phi_rad / omega # Time delay in seconds
print(f"Frequency: {f} Hz")
print(f" Phase shift: {delta_t * 1000:.4f} ms (Δt), {phi_deg:.2f}°\n")
v_out = H_mag * np.sin(omega * t + phi_rad)
plt.subplot(len(frequencies), 1, i + 1)
plt.plot(t * 1000, v_in, label="Input Signal")
plt.plot(t * 1000, v_out, label="Filtered Output")
plt.title(f"RC High-Pass Filter Response at {f} Hz")
plt.xlabel("Time (ms)")
plt.ylabel("Amplitude")
plt.grid(True, linestyle="--")
plt.legend()
plt.tight_layout()
plt.show()
Want more?
This lecture gives you a taste of what to expect in the full course. If you’re interested in learning more about electronics, specifically first-order filters, practical circuit analysis, and how to use powerful tools like the Analog Discovery 3, consider subscribing to the Tech Explorations email list. Subscribers will receive exclusive updates and a special discount coupon when the course is published.