added rectangular window

This commit is contained in:
Ahmet Inan 2018-03-03 08:29:07 +01:00
commit c53e782b3c

View file

@ -9,6 +9,20 @@ Copyright 2018 Ahmet Inan <inan@aicodix.de>
namespace DSP {
template <int TAPS, typename TYPE>
class Rect
{
TYPE w[TAPS];
public:
Rect()
{
for (int n = 0; n < TAPS; ++n)
w[n] = TYPE(1);
}
inline TYPE operator () (int n) { return n >= 0 && n < TAPS ? w[n] : 0; }
inline operator const TYPE * () const { return w; }
};
template <int TAPS, typename TYPE>
class Hann
{