• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Advertise
  • Subscribe

Test & Measurement Tips

Oscilloscopes, electronics engineering industry news, how-to EE articles and electronics resources

  • Oscilloscopes
    • Analog Oscilloscope
    • Digital Oscilloscope
    • Handheld Oscilloscope
    • Mixed-signal Oscilloscope
    • PC-based Oscilloscopes – PCO
  • Design
  • Calibration
  • Meters & Testers
  • Test Equipment
  • Learn
    • eBooks/Tech Tips
    • FAQs
    • EE Training Days
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Video
    • EE Videos
    • Teardown Videos
  • Resources
    • Design Guide Library
    • Digital Issues
    • Engineering Diversity & Inclusion
    • Leap Awards
    • White Papers
  • Subscribe
You are here: Home / Featured / How to use convolution to implement filters: part 1

How to use convolution to implement filters: part 1

February 26, 2025 By Rick Nelson Leave a Comment

Convolution is used in a variety of signal-processing applications, including time-domain-waveform filtering.

In a recent series on the inverse fast Fourier transform (FFT), we concluded with a mention of convolution and its application to filtering.

Convolution

Q: What is convolution?
A: Convolution, denoted by * symbol, combines two functions to form a third function in accordance with this integral:

As with the Fourier transform, there is a discrete version:

What’s an application for convolution?
A: If you have an arbitrary function of time f(t) and you know a filter’s impulse response h(t), you can substitute h(t) for g(t) in either of the above equations and calculate the filter’s output, as shown in Figure 1.

Figure 1. You can use convolution to calculate an output signal if you know a filter’s impulse response.

What role does t play?
A: t is a dummy variable over which we perform integration (Eq. 1) or summation (Eq. 2). An example using simple geometric shapes helps illustrate how convolution works. In Figure 2a, f(t) is a rectangular pulse, or boxcar function, that equals 1 for time units 0 to 10 and 0 everywhere else. In contrast, g(t) is a single sawtooth cycle that rises from 0 to 1 in 10 time units and is 0 everywhere else. Because g(t) is zero outside a well-defined time window, a filter with such an impulse response is called a finite-impulse-response (FIR) filter.

To convolve these two functions, we convert both to functions of t and plot them on the same t-axis (Figure 2b). Then, we mirror g(t ) around the y-axis, forming g(-t), as shown in Figure 2c, keeping in mind that g(-t) does not equal –g(t). Finally, we bring t back into the picture by adding a time delay t to g(-t), forming g(t–t). For t=0, g(t–t) remains the same as g(-t) in Figure 2c, as indicated in Figure 2d, which also shows g(t–t) for t = -20. Now, we can use Eq. 2 to calculate the products and sums necessary to determine output y(t).

Figure 2. To convolve two-time functions (a), plot them on the same x-axis (b), mirror one about the y-axis (c), and add a time shift (d).

It looks as though the products and sums will all be zero for values of t less than 0; is that right?
A: Right, so there’s no need to go back to minus infinity or as close as we can come within the limits of our oscilloscope’s acquisition memory. We’ll start our calculation at t=0, as shown in Figure 2c and repeated in Figure 3a. We note that the product of f(t)g(t–t ) is zero, so we record that value for future use in plotting y(t). Next, in Figure 3b, we increment t by one, shifting g(t–t) one-time unit to the right. We notice that g(t–t) overlaps f(t) in the form of a triangle whose height hT is 0.1 and width wT is 1, and we see that y(1)=0.1×1/2=0.05.

Figure 3. Beginning with t=0 (a), we calculate the sum of products for t=1 (b), t=2 (c), and so on, keeping in mind that we must calculate the products for each integer value of t.

So, next, we can increment t again to t=2, as in Figure 3c, where we have a triangle of height 0.2 and width 2 for a total area of 0.02, correct?
A: That’s the correct answer for this example, but we are in danger of a major mistake. Let’s look at t=7 in Figure 3d to get a closer look. Here, the product is represented by a triangle of height 0.7 and width 7 for an area of 2.45. But we don’t know in advance that g(t) will be a straight line from t=0 to t=7, so we have to evaluate the seven products for each integer value of t individually and sum them, as shown by the seven alternatively shaded yellow and blue segments and associated equations in Figure 3d. Note that if g(t) actually followed the trajectory of the red dashed line from t =1 to t =6, our triangle approximation would miss an area of 1.25.

Can we plot y(t) now?
A: Yes. The blue curve in Figure 4 shows y(t), along with snapshots of the convolution diagrams for  y = 0, 5, 10, 15, and 20.

Figure 4. With the sums of products calculated for t=1 through t=20, we can plot y(t).

Could you provide a more useful example of convolution?
A: Next time, we will look at a practical example of convolution for a signal-filtering application.

Related EE World content

Measuring active and passive filters
Making best use of acquisition memory in digital storage oscilloscopes
Fast Fourier Transforms
Filters, Part 1: Analog, switched, and digital filters
An overview of filters and their parameters, Part 1: Context
Why does the Fourier Transform provide apparently inaccurate results, and what can I do about it? Part 1

You may also like:


  • How to calculate and apply the inverse discrete Fourier transform:…

  • How to calculate and apply the inverse discrete Fourier transform:…
  • time and frequency
    How to calculate and apply an inverse FFT: part 2

  • How to calculate and apply an inverse FFT: part 1

Filed Under: Digital Oscilloscope, FAQ, Featured, Oscilloscopes

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Featured Contributions

Why engineers need IC ESD and TLP data

Verify, test, and troubleshoot 5G Wi-Fi FWA gateways

How to build and manage a top-notch test team

How to use remote sensing for DC programmable power supplies

The factors of accurate measurements

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE TRAINING CENTER

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“test
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.
“bills

RSS Current EDABoard.com discussions

  • Industrial Relay Board Design for Motorcycle Use
  • buffer conf
  • Voice extraction from a song
  • Step Up Push Pull Transformer design / construction
  • Is Silent Sound Spread Spectrum real?

RSS Current Electro-Tech-Online.com Discussions

  • Impact of Tariffs on PCB Fab
  • The Analog Gods Hate Me
  • Earbud wiring w/ mic
  • Simple LED Analog Clock Idea
  • My Advanced Realistic Humanoid Robots Project
Search Millions of Parts from Thousands of Suppliers.

Search Now!
design fast globle

Footer

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips

Test & Measurement Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy