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.

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.

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
Leave a Reply
You must be logged in to post a comment.