In matlab, a length 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

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

>> hamming(3) % same in Matlab and Octave ans = 0.0800 1.0000 0.0800 >> hamming(3,'symmetric') % Matlab only ans = 0.0800 1.0000 0.0800 >> hamming(3,'periodic') % Matlab only ans = 0.0800 0.7700 0.7700 >> hamming(4) % same in Matlab and Octave ans = 0.0800 0.7700 0.7700 0.0800

[How to cite this work] [Order a printed hardcopy] [Comment on this page via email]

[Watch the Video] [Work some Exercises] [Examination]

Copyright ©

Center for Computer Research in Music and Acoustics (CCRMA), Stanford University