LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp_window.h
Go to the documentation of this file.
1#pragma once
2#include "lasp_mathtypes.h"
3
7class Window {
8
9 public:
10 enum class WindowType {
11 Hann = 0,
12 Hamming = 1,
13 Rectangular = 2,
14 Bartlett = 3,
15 Blackman = 4,
16
17 };
25 static std::string toText(const WindowType wt) {
26 switch(wt) {
27 case(WindowType::Hann): {
28 return "Hann";
29 }
30 break;
31 case(WindowType::Hamming): {
32 return "Hamming";
33 }
34 break;
36 return "Rectangular";
37 }
38 break;
40 return "Bartlett";
41 }
42 break;
44 return "Blackman";
45 }
46 break;
47 }
48 throw std::runtime_error("Not implemenented window type");
49 }
50
59 static vd create(const WindowType w,const us len);
60
68 static vd hann(const us len);
69
77 static vd hamming(const us len);
85 static vd rectangular(const us len);
86
94 static vd bartlett(const us len);
95
103 static vd blackman(const us len);
104
105};
Window (aka taper) functions of a certain type.
Definition lasp_window.h:7
static vd create(const WindowType w, const us len)
Dispatcher: create a window based on enum type and len.
static vd bartlett(const us len)
Bartlett window.
static vd hamming(const us len)
Hamming window.
static std::string toText(const WindowType wt)
Convert a window type enum to its equivalent text.
Definition lasp_window.h:25
static vd blackman(const us len)
Blackman window.
static vd rectangular(const us len)
Rectangular (boxcar) window.
arma::Col< d > vd
size_t us
We often use boolean values.
Definition lasp_types.h:29