diff base/Window.h @ 162:3fe6660f8fe2

* timestretcher improvements -- simplify API (it can calculate its own processing block sizes etc)
author Chris Cannam
date Wed, 13 Sep 2006 11:56:44 +0000
parents 0ba66b160a02
children 524bcd89743b
line wrap: on
line diff
--- a/base/Window.h	Mon Sep 11 16:40:18 2006 +0000
+++ b/base/Window.h	Wed Sep 13 11:56:44 2006 +0000
@@ -55,6 +55,7 @@
 	for (size_t i = 0; i < m_size; ++i) dst[i] = src[i] * m_cache[i];
     }
 
+    T getArea() { return m_area; }
     T getValue(size_t i) { return m_cache[i]; }
 
     WindowType getType() const { return m_type; }
@@ -64,6 +65,7 @@
     WindowType m_type;
     size_t m_size;
     T *m_cache;
+    T m_area;
     
     void encache();
     void cosinewin(T *, T, T, T, T);
@@ -137,6 +139,12 @@
     }
 	
     m_cache = mult;
+
+    m_area = 0;
+    for (int i = 0; i < n; ++i) {
+        m_area += m_cache[i];
+    }
+    m_area /= n;
 }
 
 template <typename T>