lasp/src/lasp/dsp/lasp_window.h

74 lines
1.6 KiB
C++

#pragma once
#include "lasp_mathtypes.h"
/**
* @brief Window (aka taper) functions of a certain type
*/
class Window {
public:
enum class WindowType {
Hann = 0,
Hamming = 1,
Rectangular = 2,
Bartlett = 3,
Blackman = 4,
};
/**
* @brief Dispatcher: create a window based on enum type and len
*
* @param w Window type
* @param len Length of the window (typically, integer power of two).
*
* @return Window vector of values
*/
static vd create(const WindowType w,const us len);
/**
* @brief Hann window
*
* @param len Length of the window (typically, integer power of two).
*
* @return vector of values
*/
static vd hann(const us len);
/**
* @brief Hamming window
*
* @param len Length of the window (typically, integer power of two).
*
* @return vector of values
*/
static vd hamming(const us len);
/**
* @brief Rectangular (boxcar) window.
*
* @param len Length of the window (typically, integer power of two).
*
* @return vector of values
*/
static vd rectangular(const us len);
/**
* @brief Bartlett window.
*
* @param len Length of the window (typically, integer power of two).
*
* @return vector of values
*/
static vd bartlett(const us len);
/**
* @brief Blackman window.
*
* @param len Length of the window (typically, integer power of two).
*
* @return vector of values
*/
static vd blackman(const us len);
};