Signalsmith Audio's DSP Library  1.6.0
Useful C++ classes/templates for audio effects
Static Methods | Methods
signalsmith::windows::Kaiser Class Reference

#include <windows.h>

Detailed Description

The Kaiser window (almost) maximises the energy in the main-lobe compared to the side-lobes.

Kaiser windows can be constructing using the shape-parameter (beta) or using the static with???() methods.

Static Methods

static double bandwidthToEnbw (double bandwidth, bool heuristicOptimal=false)
 Equivalent noise bandwidth (ENBW), a measure of frequency resolution. More...
 
Bandwidth methods
static Kaiser withBandwidth (double bandwidth, bool heuristicOptimal=false)
 
static double bandwidthToBeta (double bandwidth, bool heuristicOptimal=false)
 Returns the Kaiser shape where the main lobe has the specified bandwidth (as a factor of 1/window-length). More...
 
static double betaToBandwidth (double beta)
 
Performance methods
static double bandwidthToEnergyDb (double bandwidth, bool heuristicOptimal=false)
 Total energy ratio (in dB) between side-lobes and the main lobe. More...
 
static double energyDbToBandwidth (double energyDb, bool heuristicOptimal=false)
 
static double bandwidthToPeakDb (double bandwidth, bool heuristicOptimal=false)
 Peak ratio (in dB) between side-lobes and the main lobe. More...
 
static double peakDbToBandwidth (double peakDb, bool heuristicOptimal=false)
 

Methods

 Kaiser (double beta)
 Set up a Kaiser window with a given shape. beta is pi*alpha (since there is ambiguity about shape parameters) More...
 
double operator() (double unit)
 Return the window's value for position in the range [0, 1]. More...
 
template<typename Data >
void fill (Data &&data, int size) const
 Fills an arbitrary container with a Kaiser window. More...
 

Constructor & Destructor Documentation

◆ Kaiser()

signalsmith::windows::Kaiser::Kaiser ( double  beta)
inline

Set up a Kaiser window with a given shape. beta is pi*alpha (since there is ambiguity about shape parameters)

Method Details

◆ bandwidthToBeta()

static double signalsmith::windows::Kaiser::bandwidthToBeta ( double  bandwidth,
bool  heuristicOptimal = false 
)
inlinestatic

Returns the Kaiser shape where the main lobe has the specified bandwidth (as a factor of 1/window-length).

You can see that the main lobe matches the specified bandwidth.

If heuristicOptimal is enabled, the main lobe width is slightly wider, improving both the peak and total energy - see bandwidthToEnergyDb() and bandwidthToPeakDb().

The main lobe extends to ±bandwidth/2.

◆ bandwidthToEnbw()

static double signalsmith::windows::Kaiser::bandwidthToEnbw ( double  bandwidth,
bool  heuristicOptimal = false 
)
inlinestatic

Equivalent noise bandwidth (ENBW), a measure of frequency resolution.

Measured ENBW, with and without the heuristic bandwidth adjustment.

This approximation is accurate to ±0.05 up to a bandwidth of 22.

◆ bandwidthToEnergyDb()

static double signalsmith::windows::Kaiser::bandwidthToEnergyDb ( double  bandwidth,
bool  heuristicOptimal = false 
)
inlinestatic

Total energy ratio (in dB) between side-lobes and the main lobe.

Measured main/side lobe energy ratio. You can see that the heuristic improves performance for all bandwidth values.

This function uses an approximation which is accurate to ±0.5dB for 2 ⩽ bandwidth ≤ 10, or 1 ⩽ bandwidth ≤ 10 when heuristicOptimalis enabled.

◆ bandwidthToPeakDb()

static double signalsmith::windows::Kaiser::bandwidthToPeakDb ( double  bandwidth,
bool  heuristicOptimal = false 
)
inlinestatic

Peak ratio (in dB) between side-lobes and the main lobe.

,Measured main/side lobe peak ratio. You can see that the heuristic improves performance, except in the bandwidth range 1-2 where peak ratio was sacrificed to improve total energy ratio.

This function uses an approximation which is accurate to ±0.5dB for 2 ⩽ bandwidth ≤ 9, or 0.5 ⩽ bandwidth ≤ 9 when heuristicOptimalis enabled.

◆ fill()

template<typename Data >
void signalsmith::windows::Kaiser::fill ( Data &&  data,
int  size 
) const
inline

Fills an arbitrary container with a Kaiser window.

◆ operator()()

double signalsmith::windows::Kaiser::operator() ( double  unit)
inline

Return the window's value for position in the range [0, 1].