mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 15:29:28 -05:00
Template ClockRecovery for ErrorFilter type.
This commit is contained in:
parent
9879af37d5
commit
474eaa8541
@ -105,13 +105,16 @@ private:
|
|||||||
const float weight;
|
const float weight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename ErrorFilter>
|
||||||
class ClockRecovery {
|
class ClockRecovery {
|
||||||
public:
|
public:
|
||||||
ClockRecovery(
|
ClockRecovery(
|
||||||
const float sampling_rate,
|
const float sampling_rate,
|
||||||
const float symbol_rate,
|
const float symbol_rate,
|
||||||
|
const ErrorFilter error_filter,
|
||||||
std::function<void(const float)> symbol_handler
|
std::function<void(const float)> symbol_handler
|
||||||
) : resampler(sampling_rate, symbol_rate * timing_error_detector.samples_per_symbol),
|
) : resampler(sampling_rate, symbol_rate * timing_error_detector.samples_per_symbol),
|
||||||
|
error_filter { error_filter },
|
||||||
symbol_handler { symbol_handler }
|
symbol_handler { symbol_handler }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -136,7 +139,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
dsp::interpolation::LinearResampler resampler;
|
dsp::interpolation::LinearResampler resampler;
|
||||||
GardnerTimingErrorDetector timing_error_detector;
|
GardnerTimingErrorDetector timing_error_detector;
|
||||||
FixedErrorFilter error_filter;
|
ErrorFilter error_filter;
|
||||||
std::function<void(const float)> symbol_handler;
|
std::function<void(const float)> symbol_handler;
|
||||||
|
|
||||||
void resampler_callback(const float interpolated_sample) {
|
void resampler_callback(const float interpolated_sample) {
|
||||||
|
@ -78,9 +78,10 @@ private:
|
|||||||
1
|
1
|
||||||
};
|
};
|
||||||
|
|
||||||
clock_recovery::ClockRecovery clock_recovery {
|
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery {
|
||||||
static_cast<float>(sampling_rate / 4),
|
static_cast<float>(sampling_rate / 4),
|
||||||
9600,
|
9600,
|
||||||
|
{ 0.0012f },
|
||||||
[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;
|
||||||
|
Loading…
Reference in New Issue
Block a user