window

Windowing functions for digital signal processing

npm install dsp-window

All window functions have some extra properties:

  • rov: recommended overlap

This is part of dsp-kit

References

https://www.dsprelated.com/freebooks/sasp/Spectrum_Analysis_Windows.html

Source:
Example
const dsp = require('dsp-kit')
dsp.fill(1024, dsp.window.hanning())

Members

(static, constant) blackmanHarris

The Blackman-Harris window is one of a family of window functions given by a sum of cosine terms. By varying the number and coefficients of the terms different characteristics can be optimized.

Source:

(static, constant) hanning

The Hanning window (one of a family of ‘raised cosine’ windows) is also known as ‘Hann window’. Do not confuse it with the ‘Hamming’ window.

  • Smooth transition to zero at window endpoints
  • Roll-off is asymptotically -18 dB per octave
  • First side lobe is -31dB relative to main-lobe peak
Source:

(static, constant) rectangular

The rectangular window, also sometimes called ‘uniform window’, is given by w = 1, equivalent to using no window at all.

Although there are some special applications where the rectangular window is advantageous, it is probably not useful for any of our applications

  • Abrupt transition from 1 to 0 at the window endpoints
  • Roll-off is asymptotically -6dB per octave
  • First side lobe is -13dB relative to main-lobe peak
Source: