qm-dsp
1.8
SincWindow.h
Go to the documentation of this file.
1
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3
/*
4
QM DSP library
5
Centre for Digital Music, Queen Mary, University of London.
6
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the
10
License, or (at your option) any later version. See the file
11
COPYING included with this distribution for more information.
12
*/
13
14
#ifndef SINC_WINDOW_H
15
#define SINC_WINDOW_H
16
17
#include <vector>
18
23
class
SincWindow
24
{
25
public
:
33
SincWindow
(
int
length,
double
p) :
m_length
(length),
m_p
(p) {
init
(); }
34
35
int
getLength
()
const
{
36
return
m_length
;
37
}
38
39
const
double
*
getWindow
()
const
{
40
return
m_window
.data();
41
}
42
43
void
cut
(
double
*src)
const
{
44
cut
(src, src);
45
}
46
47
void
cut
(
const
double
*src,
double
*dst)
const
{
48
for
(
int
i = 0; i <
m_length
; ++i) {
49
dst[i] = src[i] *
m_window
[i];
50
}
51
}
52
53
private
:
54
int
m_length
;
55
double
m_p
;
56
std::vector<double>
m_window
;
57
58
void
init
();
59
};
60
61
#endif
SincWindow::m_length
int m_length
Definition
SincWindow.h:54
SincWindow::getLength
int getLength() const
Definition
SincWindow.h:35
SincWindow::cut
void cut(const double *src, double *dst) const
Definition
SincWindow.h:47
SincWindow::init
void init()
Definition
SincWindow.cpp:19
SincWindow::cut
void cut(double *src) const
Definition
SincWindow.h:43
SincWindow::getWindow
const double * getWindow() const
Definition
SincWindow.h:39
SincWindow::m_p
double m_p
Definition
SincWindow.h:55
SincWindow::SincWindow
SincWindow(int length, double p)
Construct a windower of the given length, containing the values of sinc(x) with x=0 in the middle,...
Definition
SincWindow.h:33
SincWindow::m_window
std::vector< double > m_window
Definition
SincWindow.h:56
base
SincWindow.h
Generated by
1.15.0