Hamming Window Generator
Overview
The Hamming window, named for R. W. Hamming, is a window function that tapers a signal towards its edges with non-zero endpoints. The Hamming window features a moderate rolloff rate and optimized to minimize the nearest side lobe, allowing for a fair mix of spectral resolution and noise reduction.
The formula for the Hamming window is:
w(n) = 0.54 - 0.46 * cos(2pi*n/(N-1))
Aside from its common use as a window function, the Q DSP library also utilizes the hamming window generator for modulating the audio signal and generating complex envelopes.
Declaration
struct hamming_gen
{
hamming_gen(duration width, float sps);
float operator()();
void config(duration width, float sps;
void reset();
void midpoint();
};
Expressions
hamming_gen
is a model of Generator
. In addition to valid expressions for Generator
, hamming_gen
allows these expressions.
Notation
g
-
Object of type
hamming_gen
. w
-
Object of type
duration
. sps
-
Floating point value representing samples per second.