mirror of
https://github.com/aicodix/dsp.git
synced 2026-04-27 14:30:36 +00:00
added rectangular window
This commit is contained in:
parent
799c09a0fb
commit
c53e782b3c
1 changed files with 14 additions and 0 deletions
14
window.hh
14
window.hh
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue