Blackman Window Generator
Overview
The Blackman taper is a type of window function that gradually tapers the amplitude of a signal towards the window’s edges. It is often used in digital signal processing to smooth a signal (smoothing discontinuities at the edges of sampled signals) or to reduce spectral leakage. The Blackman window has a wider main lobe and lower level side lobes than other windows. It is named after Robert Blackman, who first described it in 1958.
The formula for the Blackman window is:
w(n) = 0.42 - 0.5 * cos(2pi*n/(N-1)) + 0.08 * cos(4pi*n/(N-1))
Aside from its common use as a window function, the Q DSP library also utilizes the blackman window generator for modulating the audio signal and generating complex envelopes.
Declaration
struct blackman_gen
{
blackman_gen(duration width, float sps);
float operator()();
void config(duration width, float sps;
void reset();
void midpoint();
};
Expressions
blackman_gen
is a model of Generator
. In addition to valid expressions for Generator
, blackman_gen
allows these expressions.
Notation
g
-
Object of type
blackman_gen
. w
-
Object of type
duration
. sps
-
Floating point value representing samples per second.
Ramp Generators
Two subclasses of blackman_gen
are specialized for ramp generation:
-
The Blackman upward ramp generator generates a rising curve with the shape of the first half of a Blackman window taper.
-
The Blackman downward ramp generator generates a falling curve with the shape of the second half of a Blackman window taper.
Declaration
struct blackman_upward_ramp_gen : blackman_gen
{
blackman_upward_ramp_gen(duration width, float sps);
void config(duration width, float sps);
};
struct blackman_downward_ramp_gen : blackman_gen
{
blackman_downward_ramp_gen(duration width, float sps);
void reset();
void config(duration width, float sps);
};