ELECTRONICS - FilterS - guide series

Introduction to Electronics - Filters: Example: Compare a filtered and unfiltered signal

Learn how a low-pass filter enhances signal clarity by removing high-frequency noise while preserving meaningful low-frequency content. Understand the impact of filtering through a simple, visual comparison of raw and processed signals.

To better understand the purpose of filters, it is very helpful to visualise the difference between an unfiltered signal and its filtered counterpart.  In this guide, we will look at a simple example using a low-pass filter. We will see, in a qualitative way, how a filter can clean up a signal by removing unwanted high-frequency noise.

We will not dive into the mathematical details yet. The goal here is to build an intuitive understanding of the effect that a filter has on a signal.  You will learn the technical reasons behind this behaviour later in the guide.

Example: Low-pass filter

Suppose we have a signal that consists of two components:

  • A slow, low-frequency component (for example, a temperature sensor reading).
  • A fast, high-frequency noise component (for example, electrical interference from nearby equipment).

In real circuits, this kind of situation is very common. Sensors often pick up unwanted noise from their environment. We can use a low-pass filter to allow the slow signal to pass through while reducing or removing the fast noise. Here is the basic structure of the first-order RC low-pass filter we are using:

Below is a simple Python script that generates an unfiltered signal and its filtered version using a basic low-pass filter model:

import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import butter, filtfilt

# Create a time array
t = np.linspace(0, 1, 1000) # 1 second duration, 1000 samples

# Create a signal: low-frequency signal + high-frequency noise
low_freq_signal = np.sin(2 * np.pi * 5 * t) # 5 Hz component
high_freq_noise = 0.5 * np.sin(2 * np.pi * 250 * t) # 250 Hz noise
signal = low_freq_signal + high_freq_noise

# Design a simple first-order Butterworth low-pass filter
cutoff_frequency = 20 # 20 Hz cutoff
b, a = butter(N=1,
Wn=cutoff_frequency / (0.5 * 1000),
btype='low') # N=1 for first-order

# Apply the filter
filtered_signal = filtfilt(b, a, signal)

# Plotting
plt.figure(figsize=(12, 6))
plt.plot(t, signal, label='Unfiltered Signal', alpha=0.7)
plt.plot(t, filtered_signal, label='Filtered Signal', linewidth=2)
plt.xlabel('Time (seconds)')
plt.ylabel('Amplitude')
plt.title('Unfiltered vs. Filtered Signal')
plt.legend()
plt.grid(True)
plt.show()

This script generates a signal that combines a low-frequency sine wave with high-frequency noise. It then applies a simple first-order low-pass filter with a cutoff frequency of 20 Hz. Finally, it plots both the original and the filtered signal for easy comparison.

Here is the plot:

What do we see in the plot?

When you run this simulation, you will notice the following:

  • The unfiltered signal (blue) looks very noisy and messy. It is difficult to clearly see the underlying slow movement of the signal.
  • The filtered signal (orange) appears much smoother. The unwanted fast variations are greatly reduced, making it easier to see the true behaviour of the original low-frequency signal.

This is the essence of what a filter does: it improves the quality of a signal by removing unwanted parts without disturbing the useful information too much.

Later in the guide, you will learn how the resistor and capacitor work together to create the filtering effect. You will also learn how to calculate the cutoff frequency and how different filters affect different types of signals. For now, it is enough to see that even a very simple circuit can have a big impact on the quality of the information that a system processes.

Ready for the next tutorial in this series? Here's the next one, or choose an alternative from the list of articles in the side bar. There's also lots of interesting article in our Blog. where you can read about off-grid communication technologies, electronics test equipment, course updates, and much more.

INTRODUCTION TO ELECTRONICS FILTERS

This course and eBook introduces the core concepts of RC and RL filters, helping you understand, design, and analyse these essential circuits. You will learn how low-pass and high-pass filters shape signals, calculate key parameters like cutoff frequency and phase shift, and explore practical applications such as audio tone control, noise filtering, sensor signal conditioning, and switch debouncing.

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community. One email per week, no spam; unsubscribe at any time

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}