Move Baseband/RSSI threads into Processors.

This commit is contained in:
Jared Boone 2016-06-25 11:11:37 -07:00
parent 74c8429f75
commit 525e72ac86
9 changed files with 44 additions and 2 deletions

View File

@ -50,8 +50,6 @@ public:
private:
static Thread* thread_event_loop;
BasebandThread baseband_thread { NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
bool is_running = true;

View File

@ -23,6 +23,7 @@
#define __PROC_AIS_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "channel_decimator.hpp"
#include "matched_filter.hpp"
@ -47,6 +48,10 @@ public:
void execute(const buffer_c8_t& buffer) override;
private:
static constexpr size_t baseband_fs = 2457600;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),

View File

@ -23,6 +23,8 @@
#define __PROC_AM_AUDIO_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "rssi_thread.hpp"
#include "dsp_decimate.hpp"
#include "dsp_demodulate.hpp"
@ -44,6 +46,9 @@ private:
static constexpr size_t decim_2_decimation_factor = 4;
static constexpr size_t channel_filter_decimation_factor = 1;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),

View File

@ -23,6 +23,9 @@
#define __PROC_CAPTURE_HPP__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "rssi_thread.hpp"
#include "dsp_decimate.hpp"
#include "spectrum_collector.hpp"
@ -45,6 +48,9 @@ private:
static constexpr size_t baseband_fs = 4000000;
static constexpr auto spectrum_rate_hz = 50.0f;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),

View File

@ -23,6 +23,7 @@
#define __PROC_ERT_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "channel_decimator.hpp"
@ -61,6 +62,8 @@ private:
const size_t samples_per_symbol = channel_sampling_rate / symbol_rate;
const float clock_recovery_rate = symbol_rate * 2;
BasebandThread baseband_thread { baseband_sampling_rate, this, NORMALPRIO + 20 };
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery {
clock_recovery_rate, symbol_rate, { 1.0f / 18.0f },
[this](const float symbol) { this->consume_symbol(symbol); }

View File

@ -23,6 +23,8 @@
#define __PROC_NFM_AUDIO_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "rssi_thread.hpp"
#include "dsp_decimate.hpp"
#include "dsp_demodulate.hpp"
@ -41,6 +43,9 @@ public:
private:
static constexpr size_t baseband_fs = 3072000;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),

View File

@ -23,6 +23,8 @@
#define __PROC_TPMS_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "rssi_thread.hpp"
#include "channel_decimator.hpp"
#include "matched_filter.hpp"
@ -62,6 +64,11 @@ public:
void execute(const buffer_c8_t& buffer) override;
private:
static constexpr size_t baseband_fs = 2457600;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),

View File

@ -23,6 +23,8 @@
#define __PROC_WFM_AUDIO_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "rssi_thread.hpp"
#include "dsp_decimate.hpp"
#include "dsp_demodulate.hpp"
@ -40,6 +42,9 @@ private:
static constexpr size_t baseband_fs = 3072000;
static constexpr auto spectrum_rate_hz = 50.0f;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),

View File

@ -23,6 +23,9 @@
#define __PROC_WIDEBAND_SPECTRUM_H__
#include "baseband_processor.hpp"
#include "baseband_thread.hpp"
#include "rssi_thread.hpp"
#include "spectrum_collector.hpp"
#include "message.hpp"
@ -38,6 +41,11 @@ public:
void on_message(const Message* const message) override;
private:
static constexpr size_t baseband_fs = 20000000;
BasebandThread baseband_thread { baseband_fs, this, NORMALPRIO + 20 };
RSSIThread rssi_thread { NORMALPRIO + 10 };
SpectrumCollector channel_spectrum;
std::array<complex16_t, 256> spectrum;