From 3a96c04aa73d2f0c2b580dd73de11e94065e58db Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 21 Aug 2015 09:19:08 -0700 Subject: [PATCH] Implement, use configuration for FM demod deviation. --- firmware/baseband/dsp_demodulate.hpp | 6 +++++- firmware/baseband/main.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/baseband/dsp_demodulate.hpp b/firmware/baseband/dsp_demodulate.hpp index 09149285..c5f871e1 100644 --- a/firmware/baseband/dsp_demodulate.hpp +++ b/firmware/baseband/dsp_demodulate.hpp @@ -55,9 +55,13 @@ public: buffer_s16_t dst ); + void configure(const float sampling_rate, const float deviation_hz) { + k = static_cast(32767.0f / (2.0 * pi * deviation_hz / sampling_rate)); + } + private: complex16_t::rep_type z_; - const float k; + float k; }; } /* namespace demodulate */ diff --git a/firmware/baseband/main.cpp b/firmware/baseband/main.cpp index 7aedc677..75974d75 100755 --- a/firmware/baseband/main.cpp +++ b/firmware/baseband/main.cpp @@ -492,6 +492,7 @@ public: } void configure(const FSKConfiguration new_configuration) { + demod.configure(76800, 2 * new_configuration.symbol_rate); clock_recovery.configure(new_configuration.symbol_rate, 76800); access_code_correlator.configure( new_configuration.access_code,