Windows package overview

The Windows package defines various windows for audio signal processing. The Windows package requires functions defined in the SCMTheory package.

Windows are a finite number of non-zero samples which are multiplied with equal-sized pieces of a sound signal. Windows are used to chop up a sound signal in time in order to calculate the spectrum of the sound at that time. Typical window durations in audio are around 20-60 milliseconds.

If windows are multiplied by the sound signal such that there is no overlap in the use of sound samples, then this is called a hop size of 1. Usually the hop size is set so that the sum of sequentially hopped windows adds up to a constant value. In audio compression with time-domain aliasing cancellation techniques for example, the hop size is set to 0.5.

Shown below are plots of the more common window types used in audio signal processing. The left-hand plots show the time-domain signal normalized to the region between -1 and 1. The dots represent a sampled window, in this case 31 samples. The right-hand plots show the Fourier Transform of the time-domain samples.

The frequency resolution of a window depends on the narrowness of the main lobe in the transform plot. Notice that the rectangular window has the best frequency resolution, since the main lobe is defined by two frequency-bin widths. For the triangle window, the mainlobe is about 4 frequency-bin widths.

Notice that narrow frequency bins imply a high sidelobe level, which is bad for audio applications of windows.


Common Audio Windows


In the Windows package, each type of window type has two related functions. The first function is the name of the window followed by the letter "F". For example, the Triangle Window has a defined function TriangleF. The F-function defines a window normalized to a range of +/-1 with an maximum amplitude of 1. The F-function is a continuous funtion.

A second function defined for each window is the discrete form of the window. This function consists of the window name followed by the letter "W". The W-function samples the F-function with a specified number of points.

Here is a list of Window types defined in the Windows function:

Blackman
BlackmanHarris
Bohman
Cauchy
Cosine
DolphChebyshev
Gaussian
Hamming
Hann
HannPoisson
Kaiser
Poisson
Rectangular
Reisz
Riemann
Triangle
Turkey
VallePoussin

Note that the DolphChebyshev window does not have an F-function due to the method of designing the window in the frequency-domain and then taking the transform of the definition as the window definition.

Some of the windows have tuneable parameters. Here is a list of the parameters for those windows and their default values:

BlackmanHarris: A0->0.35875, A1->0.48829, A2->0.141128, A3->0.01168
Blackman: A0->7938/18608, A1->9240/18608, A2->1430/18608
Cauchy: Alpha->2.0
Cosine: Power->1
DolphChebyshev: Alpha->3.0
Gaussian: Alpha->2.0
Hamming: Alpha->25/46
HannPoisson: Alpha->2.0
Kaiser: Alpha->2.0
Poisson: Alpha->2.0
Turkey: Taper->0.5

There are two additional helper functions in the Windows package which were used to generate the plots above: WindowPlot and WindowTransformPlot. For example, the window plots above were created with the following code:

Almost all of the functions defined in this package are defined in the reference:

     Harris, Frederic J. "On the Use of Windows for Harmonic Analysis
         with the Discrete Fourier Transform,"  Proceedings of the 
         IEEE, Vol.66, No.1 (Janurary 1978) pp. 51-84.











craig@ccrma.stanford.edu