Sign in

Not a member? | Forgot your Password?

Search Online Books

Search tips

Free Online Books

Free PDF Downloads

A Quadrature Signals Tutorial: Complex, But Not Complicated

Understanding the 'Phasing Method' of Single Sideband Demodulation

Complex Digital Signal Processing in Telecommunications

Introduction to Sound Processing

C++ Tutorial

Introduction of C Programming for DSP Applications

Fixed-Point Arithmetic: An Introduction

Cascaded Integrator-Comb (CIC) Filter Introduction


IIR Filter Design Software

See Also

Embedded SystemsFPGA
Chapter Contents:

Search Spectral Audio Signal Processing


Book Index | Global Index

Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?


Matlab for the Hamming Window

In Matlab or Octave, a length $ M$ Hamming window is designed by the statement

w = hamming(M);
which is equivalent to
w = .54 - .46*cos(2*pi*(0:M-1)'/(M-1));
Note that M-1 is used in the denominator rather than M+1 as in the Hann window case. Since the Hamming window cannot reach zero for any choice of samples of the defining raised cosine, it makes sense not to have M+1 here. Using M-1 (instead of M) provides that the returned window is symmetric, which is usually desired. However, we will learn later that there are times when M is really needed in the denominator (such as when the window is being used successively over time in an overlap-add scheme, in which case the sum of overlapping windows must be constant).

The hamming function in the Matlab 6.1 Signal Processing Tool Box has an optional argument 'periodic' which effectively uses $ M$ instead of $ M-1$. The default case is 'symmetric'. The following examples should help clarify the difference:

>> hamming(3)
ans =
>> hamming(3,'symmetric')
ans =
>> hamming(3,'periodic')
ans =
>> hamming(4)
ans =

Previous: Hamming Window
Next: Summary of Generalized Hamming Windows

Order a Hardcopy of Spectral Audio Signal Processing

About the Author: Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and (by courtesy) of Electrical Engineering at Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See for details.


No comments yet for this page

Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )