mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 15:27:40 +00:00
Add some baseband constructors.
Some of them I think I took out earlier...
This commit is contained in:
@@ -38,6 +38,17 @@ public:
|
|||||||
By32,
|
By32,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr ChannelDecimator(
|
||||||
|
) : decimation_factor { DecimationFactor::By32 }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr ChannelDecimator(
|
||||||
|
const DecimationFactor decimation_factor
|
||||||
|
) : decimation_factor { decimation_factor }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void set_decimation_factor(const DecimationFactor f) {
|
void set_decimation_factor(const DecimationFactor f) {
|
||||||
decimation_factor = f;
|
decimation_factor = f;
|
||||||
}
|
}
|
||||||
@@ -69,7 +80,7 @@ private:
|
|||||||
dsp::decimate::DecimateBy2CIC3 cic_3;
|
dsp::decimate::DecimateBy2CIC3 cic_3;
|
||||||
dsp::decimate::DecimateBy2CIC3 cic_4;
|
dsp::decimate::DecimateBy2CIC3 cic_4;
|
||||||
|
|
||||||
DecimationFactor decimation_factor = DecimationFactor::By32;
|
DecimationFactor decimation_factor;
|
||||||
|
|
||||||
buffer_c16_t execute_decimation(buffer_c8_t buffer);
|
buffer_c16_t execute_decimation(buffer_c8_t buffer);
|
||||||
};
|
};
|
||||||
|
@@ -116,6 +116,16 @@ private:
|
|||||||
template<typename ErrorFilter>
|
template<typename ErrorFilter>
|
||||||
class ClockRecovery {
|
class ClockRecovery {
|
||||||
public:
|
public:
|
||||||
|
ClockRecovery(
|
||||||
|
const float sampling_rate,
|
||||||
|
const float symbol_rate,
|
||||||
|
ErrorFilter error_filter,
|
||||||
|
std::function<void(const float)> symbol_handler
|
||||||
|
) : symbol_handler { symbol_handler }
|
||||||
|
{
|
||||||
|
configure(sampling_rate, symbol_rate, error_filter);
|
||||||
|
}
|
||||||
|
|
||||||
ClockRecovery(
|
ClockRecovery(
|
||||||
std::function<void(const float)> symbol_handler
|
std::function<void(const float)> symbol_handler
|
||||||
) : symbol_handler { symbol_handler }
|
) : symbol_handler { symbol_handler }
|
||||||
|
@@ -49,9 +49,17 @@ public:
|
|||||||
using taps_t = tap_t[];
|
using taps_t = tap_t[];
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void configure(
|
MatchedFilter(
|
||||||
const T& taps,
|
const T& taps,
|
||||||
size_t decimation_factor = 1
|
size_t decimation_factor = 1
|
||||||
|
) {
|
||||||
|
configure(taps, decimation_factor);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void configure(
|
||||||
|
const T& taps,
|
||||||
|
size_t decimation_factor
|
||||||
) {
|
) {
|
||||||
samples_ = std::make_unique<samples_t>(taps.size());
|
samples_ = std::make_unique<samples_t>(taps.size());
|
||||||
taps_reversed_ = std::make_unique<taps_t>(taps.size());
|
taps_reversed_ = std::make_unique<taps_t>(taps.size());
|
||||||
|
@@ -37,6 +37,8 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
|
#include "ais_baseband.hpp"
|
||||||
|
|
||||||
class FSKProcessor : public BasebandProcessor {
|
class FSKProcessor : public BasebandProcessor {
|
||||||
public:
|
public:
|
||||||
using payload_t = std::bitset<1024>;
|
using payload_t = std::bitset<1024>;
|
||||||
@@ -49,10 +51,11 @@ public:
|
|||||||
void execute(buffer_c8_t buffer) override;
|
void execute(buffer_c8_t buffer) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChannelDecimator decimator;
|
ChannelDecimator decimator { ChannelDecimator::DecimationFactor::By32 };
|
||||||
dsp::matched_filter::MatchedFilter mf;
|
dsp::matched_filter::MatchedFilter mf { baseband::ais::rrc_taps_76k8_4t_p, 4 };
|
||||||
|
|
||||||
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery {
|
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery {
|
||||||
|
19200, 9600, { 0.0555f },
|
||||||
[this](const float symbol) { this->consume_symbol(symbol); }
|
[this](const float symbol) { this->consume_symbol(symbol); }
|
||||||
};
|
};
|
||||||
symbol_coding::NRZIDecoder nrzi_decode;
|
symbol_coding::NRZIDecoder nrzi_decode;
|
||||||
|
Reference in New Issue
Block a user