aboutsummaryrefslogtreecommitdiff
path: root/bartlett~.c
diff options
context:
space:
mode:
Diffstat (limited to 'bartlett~.c')
-rw-r--r--bartlett~.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/bartlett~.c b/bartlett~.c
index 61d1127..b649b67 100644
--- a/bartlett~.c
+++ b/bartlett~.c
@@ -20,14 +20,26 @@
*/
#include "m_pd.h"
-#include "windowFunctions.h"
#include <stdlib.h>
-#ifdef NT
+#include <math.h>
+
+#ifdef _MSC_VER
#pragma warning( disable : 4244 )
#pragma warning( disable : 4305 )
#endif
+
#define DEFBLOCKSIZE 64
+void fillBartlett(float *vec, int n) {
+ int i;
+ float xShift = (float)n / 2;
+ float x;
+ for (i = 0; i < n; i++) {
+ x = (i - xShift) / xShift;
+ vec[i] = (float)(1 - fabs(x));
+ }
+}
+
static t_class *bartlett_class;
typedef struct _bartlett {