Skip to Main Content Skip to Search
Product Documentation

sigwin.hamming class - Package: sigwin

Construct Hamming window object

Description

sigwin.hamming creates a handle to a Hamming window object for use in spectral analysis and FIR filtering by the window method. Object methods enable workspace import and ASCII file export of the window values.

The following equation defines the Hamming window of length N:

where M is N/2 for N even and (N+1)/2 for N odd.

The second half of the symmetric Hamming window is obtained by flipping the first half around the midpoint. The symmetric option is the preferred method when using a Hamming window in FIR filter design.

The periodic Hamming window is constructed by extending the desired window length by one sample, constructing a symmetric window, and removing the last sample. The periodic version is the preferred method when using a Hamming window in spectral analysis because the discrete Fourier transform assumes periodic extension of the input vector.

Construction

H = sigwin.hamming returns a symmetric Hamming window object H of length 64.

H = sigwin.hamming(Length) returns a symmetric Hamming window object with length Length . Length must be a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer. Entering a 1 for Length results in a window with a single value of 1.

H = sigwin.hamming(Length,SamplingFlag) returns a Hamming window with sampling Sampling_Flag. The SamplingFlag can be either 'symmetric' or 'periodic'.

Properties

Length

Hamming window length. The window length must be a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer. Entering a 1 for Length results in a window with a single value of 1.

SamplingFlag

'symmetric' is the default and forces exact symmetry between the first and second halves of the Hamming window. A symmetric window is preferred in FIR filter design by the window method.

'periodic' designs a symmetric Hamming window of length Length+1 and truncates the window to length Length. This design is preferred in spectral analysis where the window is treated as one period of a Length-point periodic sequence.

Methods

generateGenerates Hamming window
infoDisplay information about Hamming window object
winwriteSave Hamming window in ASCII file

Copy Semantics

Handle. To learn how copy semantics affect your use of the class, see Copying Objects in the MATLAB Programming Fundamentals documentation.

Examples

Default length N=64 symmetric Hamming window:

H=sigwin.hamming;
wvtool(H); 
 

Generate a length N=128 periodic Hamming window, return the values, and write ASCII file:

H=sigwin.hamming(128,'periodic');
% Return window values with generate
win=generate(H);
% Write ASCII file in current directory
% with window values
winwrite(H,'hamming_128')

References

Oppenheim, A.V. and Schafer, R.W. Discrete-time Signal Processing, Upper Saddle River, N.J: Prentice Hall, 1989, pp. 444–447.

See Also

sigwin | window | wvtool

Tutorials

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS