1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

dsp: update to deque and add rectangular window

This commit is contained in:
Manuel Pitz 2022-05-31 18:04:36 +02:00 committed by Steffen Vogel
parent dab686684c
commit 1be03ffab6
2 changed files with 14 additions and 2 deletions

View file

@ -8,7 +8,6 @@
#pragma once
#include <ranges>
#include <deque>
namespace villas {
@ -52,9 +51,14 @@ protected:
public:
Window(size_type l = 0, T i = 0) :
std::deque<T>(l, i)
Container(l, i)
{ }
T val(size_type pos)
{
return this->Container::operator[](pos);
}
T update(T in)
{
Container::push_back(in);

View file

@ -65,6 +65,14 @@ public:
// From: https://en.wikipedia.org/wiki/Window_function#Cosine-sum_windows
template<typename T>
class RectangularWindow : public CosineWindow<T> {
public:
RectangularWindow(typename Window<T>::size_type len, T i = 0) :
CosineWindow<T>(1, 0., 0., 0., 0., len, i) {}
};
template<typename T>
class HannWindow : public CosineWindow<T> {