MatchedFilter improvements

Use single set of taps for positive and negative filters.
Reverse taps (since new samples are pushed into buffer from the high end).
Make complex multiply explicit to avoid fancy but irrelevant arithmetic checks.
Compute negative filter from conjugation of positive filter taps.
Move filter power and difference calculations into MatchedFilter.
This commit is contained in:
Jared Boone
2015-10-15 13:31:00 -07:00
parent ab28639a3d
commit 4aae77f565
4 changed files with 41 additions and 16 deletions

View File

@@ -85,14 +85,8 @@ void FSKProcessor::execute(buffer_c8_t buffer) {
static_cast<float>(channel.p[i].real()),
static_cast<float>(channel.p[i].imag())
};
mf_0.execute_once(sample);
if( mf_1.execute_once(sample) ) {
const auto value_0 = mf_0.get_output();
const float mag_0 = std::sqrt(value_0.real() * value_0.real() + value_0.imag() * value_0.imag());
const auto value_1 = mf_1.get_output();
const float mag_1 = std::sqrt(value_1.real() * value_1.real() + value_1.imag() * value_1.imag());
const float diff = mag_1 - mag_0;
clock_recovery(diff);
if( mf.execute_once(sample) ) {
clock_recovery(mf.get_output());
}
}