Clean up baseband processor statics.

This commit is contained in:
Jared Boone 2016-01-29 16:11:00 -08:00
parent 96898f82b2
commit 7c65a2d650
6 changed files with 17 additions and 23 deletions

View File

@ -63,18 +63,13 @@ void NarrowbandAMAudio::on_message(const Message* const message) {
}
void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
constexpr size_t baseband_fs = 3072000;
constexpr size_t decim_0_input_fs = baseband_fs;
constexpr size_t decim_0_decimation_factor = 8;
constexpr size_t decim_0_output_fs = decim_0_input_fs / decim_0_decimation_factor;
constexpr size_t decim_0_output_fs = decim_0_input_fs / decim_0.decimation_factor;
constexpr size_t decim_1_input_fs = decim_0_output_fs;
constexpr size_t decim_1_decimation_factor = 8;
constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1_decimation_factor;
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;
constexpr size_t channel_filter_decimation_factor = 1;
constexpr size_t channel_filter_output_fs = channel_filter_input_fs / channel_filter_decimation_factor;
decim_0.configure(message.decim_0_filter.taps, 33554432);

View File

@ -39,6 +39,10 @@ public:
void on_message(const Message* const message) override;
private:
static constexpr size_t baseband_fs = 3072000;
static constexpr size_t channel_filter_decimation_factor = 1;
static constexpr size_t post_channel_decimation_factor = 6;
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),
@ -56,7 +60,6 @@ private:
uint32_t channel_filter_pass_f;
uint32_t channel_filter_stop_f;
static constexpr size_t post_channel_decimation_factor = 6;
BlockDecimator<32> channel_block_buffer { post_channel_decimation_factor };
dsp::demodulate::AM demod;

View File

@ -63,18 +63,13 @@ void NarrowbandFMAudio::on_message(const Message* const message) {
}
void NarrowbandFMAudio::configure(const NBFMConfigureMessage& message) {
constexpr size_t baseband_fs = 3072000;
constexpr size_t decim_0_input_fs = baseband_fs;
constexpr size_t decim_0_decimation_factor = 8;
constexpr size_t decim_0_output_fs = decim_0_input_fs / decim_0_decimation_factor;
constexpr size_t decim_0_output_fs = decim_0_input_fs / decim_0.decimation_factor;
constexpr size_t decim_1_input_fs = decim_0_output_fs;
constexpr size_t decim_1_decimation_factor = 8;
constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1_decimation_factor;
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;
constexpr size_t channel_filter_decimation_factor = 1;
constexpr size_t channel_filter_output_fs = channel_filter_input_fs / channel_filter_decimation_factor;
constexpr size_t demod_input_fs = channel_filter_output_fs / post_channel_decimation_factor;

View File

@ -37,6 +37,10 @@ public:
void on_message(const Message* const message) override;
private:
static constexpr size_t baseband_fs = 3072000;
static constexpr size_t channel_filter_decimation_factor = 1;
static constexpr size_t post_channel_decimation_factor = 3;
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),
@ -55,7 +59,6 @@ private:
uint32_t channel_filter_pass_f = 0;
uint32_t channel_filter_stop_f = 0;
static constexpr size_t post_channel_decimation_factor = 3;
BlockDecimator<32> channel_block_buffer { post_channel_decimation_factor };
dsp::demodulate::FM demod;

View File

@ -87,19 +87,14 @@ void WidebandFMAudio::on_message(const Message* const message) {
}
void WidebandFMAudio::configure(const WFMConfigureMessage& message) {
constexpr size_t baseband_fs = 3072000;
constexpr size_t decim_0_input_fs = baseband_fs;
constexpr size_t decim_0_decimation_factor = 4;
constexpr size_t decim_0_output_fs = decim_0_input_fs / decim_0_decimation_factor;
constexpr size_t decim_0_output_fs = decim_0_input_fs / decim_0.decimation_factor;
constexpr size_t decim_1_input_fs = decim_0_output_fs;
constexpr size_t decim_1_decimation_factor = 2;
constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1_decimation_factor;
constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1.decimation_factor;
constexpr size_t demod_input_fs = decim_1_output_fs;
constexpr auto spectrum_rate_hz = 50.0f;
spectrum_interval_samples = decim_1_output_fs / spectrum_rate_hz;
spectrum_samples = 0;

View File

@ -37,6 +37,9 @@ public:
void on_message(const Message* const message) override;
private:
static constexpr size_t baseband_fs = 3072000;
static constexpr auto spectrum_rate_hz = 50.0f;
std::array<complex16_t, 512> dst;
const buffer_c16_t dst_buffer {
dst.data(),