25 #include <bqvec/VectorOps.h> 26 #include <bqvec/Allocators.h> 60 if (&w ==
this)
return *
this;
67 breakfastquay::deallocate(
m_cache);
70 inline void cut(T *
const BQ_R__ block)
const {
74 inline void cut(
const T *
const BQ_R__ src, T *
const BQ_R__ dst)
const {
97 void cosinewin(T *,
double,
double,
double,
double);
100 template <
typename T>
106 breakfastquay::v_set(
m_cache, T(1.0), n);
112 for (i = 0; i < n; ++i) {
118 for (i = 0; i < n/2; ++i) {
120 m_cache[i + n/2] *= T(1.0) - T(i) / T(n/2);
137 for (i = 0; i < n; ++i) {
138 m_cache[i] *= T(pow(2, - pow((i - (n-1)/2.0) / ((n-1)/2.0 / 3), 2)));
145 for (i = 0; i < N/4; ++i) {
146 T m = T(2 * pow(1.0 - (T(N)/2 - T(i)) / (T(N)/2), 3));
150 for (i = N/4; i <= N/2; ++i) {
152 T m = T(1.0 - 6 * pow(T(wn) / (T(N)/2), 2) * (1.0 - T(abs(wn)) / (T(N)/2)));
169 for (
int i = 0; i < n; ++i) {
175 template <
typename T>
179 for (
int i = 0; i < n; ++i) {
181 - a1 * cos((2 *
M_PI * i) / n)
182 + a2 * cos((4 *
M_PI * i) / n)
183 - a3 * cos((6 *
M_PI * i) / n));
187 template <
typename T>
203 std::cerr <<
"WARNING: Window::getNameForType: unknown type " 204 << type << std::endl;
209 template <
typename T>
223 std::cerr <<
"WARNING: Window::getTypeForName: unknown name \"" 224 << name <<
"\", defaulting to \"hanning\"" << std::endl;
void cut(const T *const BQ_R__ src, T *const BQ_R__ dst) const
static std::string getNameForType(WindowType type)
void cut(T *const BQ_R__ block) const
static WindowType getTypeForName(std::string name)
WindowType getType() const
void cosinewin(T *, double, double, double, double)
Window & operator=(const Window &w)
Window(WindowType type, int size)
Construct a windower of the given type and size.