From 394331ebd28ee559511baa169daa70aa946a4d9d Mon Sep 17 00:00:00 2001 From: furrtek Date: Wed, 1 Feb 2017 11:40:01 +0000 Subject: [PATCH] POCSAG RX now runs at 3.072MHz, like NFM audio --- firmware/application/main.cpp | 6 ++---- firmware/application/pocsag_app.hpp | 2 +- firmware/baseband/proc_pocsag.cpp | 15 ++++++++++----- firmware/baseband/proc_pocsag.hpp | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/firmware/application/main.cpp b/firmware/application/main.cpp index 047b72441..9ea928158 100755 --- a/firmware/application/main.cpp +++ b/firmware/application/main.cpp @@ -32,15 +32,15 @@ //TEST: Imperial in whipcalc //TEST: Numbers -//TEST: Jammer //TODO: Script engine ? //TODO: Morse coder for foxhunts +//TODO: Close Call multiple slices (buggy) //TODO: Finish EPAR tx //TODO: IQ replay //TODO: Wav visualizer -//TODO: File browser ? +//TODO: File browser view ? //TODO: Mousejack ? //TODO: Move frequencykeypad from ui_receiver to ui_widget (used everywhere) //TODO: ADS-B draw trajectory + GPS coordinates + scale, and playback @@ -51,7 +51,6 @@ //TODO: Show address/data bit fields in OOK TX //TODO: Scan for OOK TX //TODO: Check more OOK encoders -//TODO: POCSAG 512 and 2400 (all 3 at the same time, or parameter ?) //TODO: Use msgpack for settings, lists... on sd card //Multimon-style stuff: @@ -65,7 +64,6 @@ //TODO: LCR full message former (see norm) //TODO: AFSK NRZI -//TODO: TX power setting //TODO: Playdead amnesia and login //TODO: Setup: Play dead by default ? Enable/disable ? diff --git a/firmware/application/pocsag_app.hpp b/firmware/application/pocsag_app.hpp index c1a7dc2ee..91c10072d 100644 --- a/firmware/application/pocsag_app.hpp +++ b/firmware/application/pocsag_app.hpp @@ -65,7 +65,7 @@ public: private: static constexpr uint32_t initial_target_frequency = 466175000; - static constexpr uint32_t sampling_rate = 1536000; + static constexpr uint32_t sampling_rate = 3072000; static constexpr uint32_t baseband_bandwidth = 1750000; bool logging { false }; diff --git a/firmware/baseband/proc_pocsag.cpp b/firmware/baseband/proc_pocsag.cpp index eb3ffe225..f90e4db8c 100644 --- a/firmware/baseband/proc_pocsag.cpp +++ b/firmware/baseband/proc_pocsag.cpp @@ -37,17 +37,18 @@ #define POCSAG_BATCH_LENGTH (9 * 32) void POCSAGProcessor::execute(const buffer_c8_t& buffer) { - // Samplerate is 1.536MHz, gets 2048 samples, called at 750Hz + // This is called at 1500Hz if (!configured) return; // Get 24kHz audio const auto decim_0_out = decim_0.execute(buffer, dst_buffer); const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer); - auto audio = demod.execute(decim_1_out, audio_buffer); + const auto channel_out = channel_filter.execute(decim_1_out, dst_buffer); + auto audio = demod.execute(channel_out, audio_buffer); - // End up with 32 samples - for (uint32_t c = 0; c < 32; c++) { + // End up with 16 samples + for (uint32_t c = 0; c < 16; c++) { const int32_t audio_sample = audio.p[c] * 32768.0f; //const int32_t audio_sample = __SSAT(sample_int, 16); @@ -168,11 +169,15 @@ void POCSAGProcessor::configure(const POCSAGConfigureMessage& message) { constexpr size_t decim_1_input_fs = decim_0_output_fs; constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1.decimation_factor; + + constexpr size_t channel_filter_input_fs = decim_1_output_fs; + const size_t channel_filter_output_fs = channel_filter_input_fs / 2; - const size_t demod_input_fs = decim_1_output_fs; + const size_t demod_input_fs = channel_filter_output_fs; decim_0.configure(taps_11k0_decim_0.taps, 33554432); decim_1.configure(taps_11k0_decim_1.taps, 131072); + channel_filter.configure(taps_11k0_channel.taps, 2); demod.configure(demod_input_fs, 4500); bitrate = message.bitrate; diff --git a/firmware/baseband/proc_pocsag.hpp b/firmware/baseband/proc_pocsag.hpp index 025801967..3291820c5 100644 --- a/firmware/baseband/proc_pocsag.hpp +++ b/firmware/baseband/proc_pocsag.hpp @@ -57,7 +57,7 @@ private: //END_OF_MESSAGE = 69 }; - static constexpr size_t baseband_fs = 1536000; + static constexpr size_t baseband_fs = 3072000; BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20, baseband::Direction::Receive }; RSSIThread rssi_thread { NORMALPRIO + 10 }; @@ -75,7 +75,7 @@ private: dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { }; dsp::decimate::FIRC16xR16x32Decim8 decim_1 { }; - + dsp::decimate::FIRAndDecimateComplex channel_filter { }; dsp::demodulate::FM demod { }; uint32_t sync_timeout { 0 };