A windowed sinc filter outperforms a moving-average filter in the frequency domain.
In part 2 of this series, we described a type of convolution filter called the moving-average filter, and we demonstrated that it is effective at removing Gaussian white noise in the time domain but performs poorly in the frequency domain.
Q: Do all convolution filters perform poorly in the frequency domain?
A: No. In fact, the windowed sinc convolution filter can perform quite well in the frequency domain. To understand how that filter works, consider an ideal low-pass filter, which would pass all frequencies below a cutoff frequency and reject all higher frequencies. This characteristic is represented in the frequency domain in Figure 1, where fC equals the cutoff frequency and where the response is mirrored in the left-half plane. If we want to implement a low-pass filter by convolving an input signal with a filter’s impulse response h(t), called the filter kernel, we need to represent the Figure 1 function of frequency X(f) in the time domain.

Q: How do we do that?
A: We can use the inverse Fourier transform:
This is a simple integral since X(f) is 1 between — and zero everywhere else. Keeping in mind Euler’s formula (ejq = cosq + jsinq ) and remembering from introductory calculus that the indefinite integral of ecxdx is (1/C)ecx plus a constant, we can evaluate Eq. 1 analytically (reference [1] shows more of the algebra):
This result is in the form of the sine cardinal function, abbreviated as sinc, and we call a convolution filter that uses this function a sinc filter. Figure 2 shows one-second-long sinc-function segments of two filters with 5 and 5.5 Hz cutoff frequencies.

Q: You mentioned earlier the windowed sinc filter. Where does the window fit in?
A: Good question. Note that we cannot implement the perfect filter of Figure 1 on a computer, so we must make some compromises. First, we need to sample the waveform, and for the examples presented here, I am using a sample size of N = 256 mapped onto a time period of 1 s. As Eq. 2 and Figure 2 indicate, the sinc function is continuous (with the noted adjustment in Eq. 2 at t = 0). It has nonzero values that extend to plus and minus infinity, so our second compromise is that we must truncate it at some point—in the Figure 2 case, at 256 samples extending from -0.5 s to 0.5 s. Note also in Figure 2 that the sinc waveforms are not guaranteed to reach zero at each segment end, so we must apply a window function to force these endpoints closer to zero to avoid errors.
Q: A window function, like the Hamming window, which we discussed in an earlier series, right?
A: Yes, the Hamming window is one possibility. Another is the Blackman window. Reference [2] discusses the tradeoffs between the two. For this example, we will reuse the Hamming window. We will first translate our sinc function by N/2 samples, or 0.5 s, to the right to conveniently apply it. Figure 3 shows the Hamming in orange, our translated original sinc function in blue, and the product of the Hamming window and the translated sinc function in red. Note that the windowing does force the red trace to approach zero at each end of the sinc-function segment.

We are now ready to apply our windowed sinc filter to an arbitrary input waveform. We’ll look at how to do that using a spreadsheet next time.
References
[1] What Is a Sinc Filter? VOCAL Technologies
[2] Windowed-Sinc Filters, Analog Devices
Related EE World content
Basics of math functions on oscilloscopes
Why does the Fourier transform provide apparently inaccurate results, and what can I do about it? part 3
Understanding bandwidth concepts
Practical Filter Design Challenges and Considerations for Precision ADCs
What is phase noise, and how can I measure it? part 1
What is jitter and what can I do about it (part 1 of 2)?
Leave a Reply
You must be logged in to post a comment.