Windowing functions
A variety of generally Matlab/Octave compatible filter generation functions, including Bartlett, Blackman, Hamming, Hanning, and triangular.
bartlett(n) blackman(n) boxcar(n) flattopwin(n, sym = c('symmetric', 'periodic')) gausswin(n, w = 2.5) hamming(n) hanning(n) triang(n)
n |
length of the filter; number of coefficients to generate. |
w |
the reciprocal of the standard deviation for
|
sym |
|
triang
, unlike the bartlett window, does not go to zero at the
edges of the window. For odd n
, triang(n)
is equal to
bartlett(n+2)
except for the zeros at the edges of the window.
A main use of flattopwin
is for calibration, due
to its negligible amplitude errors. This window has low pass-band ripple, but high bandwidth.
Filter coefficients.
Original Octave versions by Paul Kienzle (boxcar
,
gausswin
, triang
) and Andreas Weingessel
(bartlett
, blackman
, hamming
, hanning
).
Conversion to R by Tom Short.
Oppenheim, A.V., and Schafer, R.W., Discrete-Time Signal Processing, Upper Saddle River, NJ: Prentice-Hall, 1999.
Gade, S., Herlufsen, H. (1987) “Use of weighting functions in DFT/FFT analysis (Part I)”, Bruel & Kjaer Technical Review No. 3.
Octave Forge http://octave.sf.net
n <- 51 op <- par(mfrow = c(3,3)) plot(bartlett(n), type = "l", ylim = c(0,1)) plot(blackman(n), type = "l", ylim = c(0,1)) plot(boxcar(n), type = "l", ylim = c(0,1)) plot(flattopwin(n), type = "l", ylim = c(0,1)) plot(gausswin(n, 5), type = "l", ylim = c(0,1)) plot(hanning(n), type = "l", ylim = c(0,1)) plot(hamming(n), type = "l", ylim = c(0,1)) plot(triang(n), type = "l", ylim = c(0,1)) par(op)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.