summaryrefslogtreecommitdiff
path: root/gfft.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-06-21 12:32:46 +0200
committerDavid Lamparter <equinox@diac24.net>2013-06-21 12:38:29 +0200
commite8d37e36f8b97fcc29c8f67d38f0cd5d48ec9d3f (patch)
treea3b493b069d16f4877cd43697bd194256d87c288 /gfft.h
parent2fd3ece434eb3656f481afd4e8801637fa8ce844 (diff)
import
Diffstat (limited to 'gfft.h')
-rw-r--r--gfft.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/gfft.h b/gfft.h
new file mode 100644
index 0000000..a92b81c
--- /dev/null
+++ b/gfft.h
@@ -0,0 +1,39 @@
+#ifndef _GFFT_H
+#define _GFFT_H
+
+#include <glib.h>
+#include <fftw3.h>
+
+#include "galsa.h"
+
+typedef void window_func(sample *in, double *out, size_t size, int ch, int nch);
+
+struct fft_runner {
+ struct device *dev;
+ GAsyncQueue *queue;
+ GThread *thread;
+ window_func *winf;
+ size_t span;
+};
+
+enum fe_message {
+ FE_DATA,
+ FE_DEV_ERROR,
+ FE_STOPPED,
+};
+
+struct fe {
+ enum fe_message message;
+ int errcode;
+ char *errp;
+ fftw_complex *data;
+ size_t size;
+};
+
+extern void window_hard(sample *in, double *out, size_t size, int ch, int nch);
+extern void window_hann(sample *in, double *out, size_t size, int ch, int nch);
+
+extern struct fft_runner *fftrun_attach(struct device *device,
+ window_func *winf, size_t span);
+
+#endif