latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.signal
Window functions for spectral analysis and filter design. A window is a
length-M sequence of weights that tapers a finite segment of a signal,
reducing the spectral leakage that comes from cutting the segment off sharply.
All window functions share a common shape of keyword arguments:
M— the window length, a positive integer.sym— whether the window is symmetric (True, the default) or periodic (False). Symmetric windows are used in filter design; periodic windows are used for spectral analysis, where the window is applied to one period of a sampled signal and the first and last samples are not duplicates.dtype,layout,device,requires_grad— the usual tensor construction arguments, so window tensors are created directly on the desired device with the desired data type.
import tensorplay as tp
from tensorplay.signal import windows
print(windows.hann(8))
print(windows.blackman(8, sym=False))
# window tensors are ordinary tensors, so they can be moved or differentiated
w = windows.kaiser(64, beta=8.0)
Window functions
Computes the Bartlett window. |
|
Computes the Blackman window. |
|
Computes a window with a simple cosine waveform, also known as the sine window. |
|
Computes a window with an exponentially decaying waveform, also known as the Poisson window. |
|
Computes a window with a Gaussian waveform. |
|
Computes the general cosine window, a weighted sum of cosines whose frequencies are integer multiples of the fundamental. |
|
Computes the general Hamming window, the two-term member of the general cosine family. |
|
Computes the Hamming window. |
|
Computes the Hann window. |
|
Computes the Kaiser window. |
|
Computes the minimum 4-term Blackman-Harris window described by Nuttall. |
Where to go next
FFT functions — windowing is typically a preamble to a spectral transform; the FFT page covers the transform side.
Tensors — the tensor APIs the window functions are built on.
Help improve this page
Found an error, an unclear step, or a missing example?

