summaryrefslogtreecommitdiff
path: root/gfft.h
diff options
context:
space:
mode:
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