summaryrefslogtreecommitdiff
path: root/controller/fw/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'controller/fw/Makefile')
-rw-r--r--controller/fw/Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/controller/fw/Makefile b/controller/fw/Makefile
index cc7d156..6c5d5ea 100644
--- a/controller/fw/Makefile
+++ b/controller/fw/Makefile
@@ -46,12 +46,16 @@ FMEAS_ADC_MAX ?= 4096
FMEAS_FFT_LEN ?= 256
FMEAS_FFT_WINDOW ?= gaussian
FMEAS_FFT_WINDOW_SIGMA ?= 16.0
+# TODO: validate
+FMEAS_SAMPLING_RATE ?= 10.0
DSSS_GOLD_CODE_NBITS ?= 5
DSSS_DECIMATION ?= 10
DSSS_THESHOLD_FACTOR ?= 4.0f
DSSS_WAVELET_WIDTH ?= 7.3
DSSS_WAVELET_LUT_SIZE ?= 69
+DSSS_FILTER_FC ?= 20e-3
+DSSS_FILTER_ORDER ?= 8
CC := $(PREFIX)gcc
CXX := $(PREFIX)g++
@@ -122,7 +126,7 @@ LDFLAGS += -L$(OPENCM3_DIR_ABS)/lib -l$(OPENCM3_LIB) $(shell $(CC) -print-libg
all: $(BUILDDIR)/$(BINARY)
-src/dsss_demod.c: $(BUILDDIR)/generated/dsss_gold_code.h
+src/dsss_demod.c: $(BUILDDIR)/generated/dsss_gold_code.h $(BUILDDIR)/generated/dsss_butter_filter.h
$(BUILDDIR)/generated/dsss_gold_code.h: $(BUILDDIR)/generated/gold_code_$(DSSS_GOLD_CODE_NBITS).h
ln -srf $< $@
@@ -139,6 +143,10 @@ $(BUILDDIR)/generated/fmeas_fft_window.c: | $(BUILDDIR)/generated
$(BUILDDIR)/generated/dsss_cwt_wavelet.c: | $(BUILDDIR)/generated
$(PYTHON3) tools/cwt_wavelet_header_gen.py -v dsss_cwt_wavelet_table $(DSSS_WAVELET_LUT_SIZE) $(DSSS_WAVELET_WIDTH) > $@
+.PRECIOUS: $(BUILDDIR)/generated/dsss_butter_filter.h
+$(BUILDDIR)/generated/dsss_butter_filter.h: | $(BUILDDIR)/generated
+ $(PYTHON3) tools/butter_filter_gen.py -m dsss_filter $(DSSS_FILTER_FC) $(FMEAS_SAMPLING_RATE) $(DSSS_FILTER_ORDER) > $@
+
$(BUILDDIR)/generated: ; mkdir -p $@
OBJS := $(addprefix $(BUILDDIR)/,$(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o))