• 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 4

How to use convolution to implement filters: part 4

March 19, 2025 By Rick Nelson Leave a Comment

A windowed sinc function can implement a low-pass filter, and a two-dimensional convolutional filter can blur or sharpen images.

In part 3 of this series, we introduced a low-pass filter based on the Sinc function and described the need for windowing to compensate for sampling and truncation.

Q: How can we apply this filter?
A:
The optimal way would be to use a professional electrical engineering software package to execute the convolution function. In part 2 of this series, we used a spreadsheet to implement a 21-point moving-average filter, but the windowed sinc function is too complex to do that conveniently. We can use a workaround, however. In the previous series on the Fourier transform and inverse Fourier transform, we used Excel to implement the fast Fourier transform (FFT) and inverse FFT (IFFT). Excel does not have a built-in convolution function, but as noted in our recent series on the inverse FFT, the FFT/IFFT can combine to perform the convolution function in a more computationally efficient manner than convolution in the time domain. The key is noting that convolution in the time domain is multiplication in the frequency domain. So, we can take the FFT of our input signal and convolution filter kernel (the windowed sinc function), multiply them in the frequency domain, and then transform the result back to the time domain using the IFFT.

Q: Can we see an example?
A:
Sure. We’ll begin with the input signal in Figure 1 at the top left, a 4-Hz sine wave, and an 8-Hz harmonic, as shown by the FFT in Figure 1 at the top center. For the filter kernel, we will choose a cutoff frequency of 5 Hz, which we can plug into the sinc function equation from part 3:

In the bottom left, the blue trace is our sinc function from Eq. 1, the orange trace is the Hamming window, discussed in part 3, and the red trace is our windowed sinc function, the product of our sinc function and the window.

Figure 1. Convolution in the time domain is multiplication in the frequency domain, so we can use the FFT and IFFT to convolve an input (top left) with a filter kernel (bottom left).

Q: So now we take the FFT of the windowed sinc function, right?
A: Right. The FFT in the center of Figure 1 shows the windowed (red) and unwindowed (blue) sinc function transform. You’ll notice the unwindowed version has more ripple than the windowed version and takes longer to reach 0 after the cutoff frequency. Now, we multiply the two transforms to get the result at the figure’s bottom center. We can see that the 8-Hz frequency component of our input has been eliminated, and we can use the IFFT to see our filtered cosine wave in the time domain (bottom right).

Q: What else do I need to know about convolution?
A: We’ve looked at two convolution filters — the moving-average and windowed-sinc filters, which are counterpoints to each other. The moving average filter has a rectangular characteristic in the time domain, and the windowed sinc filter has a rectangular characteristic in the frequency domain. And there are many other types. With our moving-average filter, for example, each point had a gain of 1, but each point could have a different gain — giving more importance to recent events, with more distant events having less influence.

Figure 2. The convolution kernel in the center blurs the original image.

Q: You also mentioned 2-D convolution back in part 2. How does that work?
A: 2-D convolution has an application for image processing. Figure 2 shows a 3×3-pixel filter kernel operating on a 3×3-pixel segment of an original image. In the figure, the kernel averages the nine pixels of the original image segment to create a new pixel. It will then successively shift one pixel to the right and then top to bottom until it has processed the entire image. The kernel in the figure, analogous to our moving-average filter, implements what’s called a box blur and has the effect of blurring the original image.

The following kernel sharpens an image:

Still, others excel at edge detection or applying a Gaussian blur. We’ll take a closer look in a future article on image processing.

References

FFT Convolution, Analog Devices
A Gentle Introduction To Convolution Filters, Medium

Related EE World Online content

How to use convolution to implement filters: part 1
Why does the Fourier Transform provide apparently inaccurate results, and what can I do about it? part 1
How to calculate and apply the inverse discrete Fourier transform: part 4
Debugging digital and analog signals with cross-domain analysis
If you are working with video signal processing, here are some tools to consider, part 1
Human presence detection and you

You may also like:


  • How to use convolution to implement filters: part 3

  • How to use convolution to implement filters: part 2

  • How to use convolution to implement filters: part 1

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

Filed Under: FAQ, Featured Tagged With: FAQ

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: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

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

  • ISL8117 buck converter blowing up
  • need of carrier supression when locking to cavity resonator
  • Wireless microphone reviews
  • audio transformers impedance
  • Help Creating .lib File for SCR in LTspice

RSS Current Electro-Tech-Online.com Discussions

  • RS485 bus: common ground wire needed or not?
  • Kawai KDP 80 Electronic Piano Dead
  • Good Eats
  • What part is this marked .AC ?
  • Photo interrupter Connections
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