# Applying a window to a signal

How can I Gaussian or Bartlett window to a signal? On the other hand, is it a good way of smoothing signals? If not what are the differences between smoothing and windowing?

• Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
– Community Bot
May 1, 2022 at 21:13

Windowing is commonly done to reduce spectral leakage in the result of a Discrete Fourier Transform (DFT). There are many other posts here that explain the finer details, but at the high level to apply a window, you use a window that is the same length as the block of time domain data for which you will be computing the DFT. The window is multiplied by the time domain data, which tapers the edges of the selected waveform in such a way that reduce spectral leakage in the frequency domain. Smoothing on the other hand is done by convolving a time domain signal with the impulse response of a low pass filter which serves to remove the high frequency components and thereby "smooth" the time domain result. Thus windowing is a product in the time domain while smoothing is a convolution. The target function that is multiplied for windowing and convolved for filtering is determined under different considerations (not the same function but can be similar).

For the more technical details of this, please see the following posts:

Filtering sidelobes

Why would one use a Hann or Bartlett window?

• Thank you so much for your answer! May 2, 2022 at 11:25

For regularly sampled data, windowing consists in multiplying a signal $$x[n]$$ or a portion of it by a window $$w[k]$$, sample by sample, as illustrated as follows (source NI). The result will be somehow a novel signal defined $$x_w[k] = w[k]x[k]$$, where the product is often assumed zero when either $$w[k]$$ or $$x[k]$$ is unknown/undefined. Smoothing is generally a weighed combination of several $$x$$ values, therefore windowing is not smoothing per se. Note however that at the left and right sides, the signal is attenuated (known as tappering) toward zero. This may have an indirect smoothing effect (as the amplitude variations is mildered). Windowing in the signal domain yields a convolution in the Fourier domain, hence a smoothing of the complex spectrum.

For windows like Bartlett or Gauss, that are unimodal, symmetric with positive coefficients, their samples can be used as weights of a smoothing filter, for instance with a form like:

$$y[\cdot] = \frac{\sum w[k]x[k]}{\sum w[k]}$$ 