summaryrefslogtreecommitdiffstats
path: root/FIR/firmath.h
diff options
context:
space:
mode:
Diffstat (limited to 'FIR/firmath.h')
-rw-r--r--FIR/firmath.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/FIR/firmath.h b/FIR/firmath.h
new file mode 100644
index 0000000..3540a98
--- /dev/null
+++ b/FIR/firmath.h
@@ -0,0 +1,43 @@
+//
+// firmath.h
+// FIR_rect_win
+//
+// Created by Jacky Jack on 04/07/2021.
+//
+
+#ifndef firmath_h
+#define firmath_h
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <math.h>
+
+typedef struct fir_t {
+ uint32_t num_taps;
+ double *fir_coef;
+} fir_t;
+
+typedef struct firw_t {
+ uint32_t num_taps;
+ double *win_coef;
+} firw_t;
+
+void fir_init(fir_t *fir, uint32_t taps);
+void firw_init(firw_t *fir_win, uint32_t taps);
+
+double math_sinx(double x);
+void fir_sinc_lp(fir_t *fir, double fc);
+void fir_sinc_hp(fir_t *fir, double omega_c);
+void fir_sinc_bp(fir_t *fir, double omega_c1, double omega_c2);
+void fir_sinc_bs(fir_t *fir, double omega_c1, double omega_c2);
+void fir_convolute(fir_t *fir,firw_t *fir_win);
+void firw_rect(firw_t *firw);
+void firw_hamming(firw_t *firw);
+void firw_hanning(firw_t *firw);
+void firw_blackman(firw_t *firw);
+void fir_print_matlab(fir_t *fir);
+void firw_print_matlab(firw_t *firw);
+void fir_print_c(fir_t *fir);
+
+#endif /* firmath_h */