Spectrum Analysis Windows
Gaussian Window and Transform
Matlab for the Gaussian WindowSearch Spectral Audio Signal Processing
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
In Matlab, w = gausswin(M,alpha) returns a length
window
with parameter
. It implements the
definition in Harris [97]:
function [w] = gausswin(M,alpha) n = -(M-1)/2 : (M-1)/2; w = exp((-1/2) * (alpha * n/(M/2)) .^ 2)';
An implementation in terms of
is as follows:
function [w] = gaussianwin(M,sigma) n= -(M-1)/2 : (M-1)/2; w = exp(-n .* n ./ (2 * sigma .* sigma))';
Note that, on a dB scale, the Gaussian is quadratic. This means that parabolic interpolation of a sampled Gaussian transform is exact. This can be a useful fact to remember when estimating sinusoidal peak frequencies in spectra. For example, one suggested implication is that, for typical windows, quadratic interpolation of spectral peaks may be more accurate on a log-magnitude scale (e.g., dB) than on a linear magnitude scale (this has been observed empirically for a variety of cases).
