mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-14 04:04:34 +00:00
Rename MatchedFilter::decimation_factor.
This commit is contained in:
parent
7a59823211
commit
3c33e20156
@ -27,7 +27,7 @@ namespace matched_filter {
|
||||
bool MatchedFilter::execute_once(
|
||||
const sample_t input
|
||||
) {
|
||||
samples_[taps_count_ - decimation_factor + decimation_phase] = input;
|
||||
samples_[taps_count_ - decimation_factor_ + decimation_phase] = input;
|
||||
|
||||
advance_decimation_phase();
|
||||
if( is_new_decimation_cycle() ) {
|
||||
@ -65,7 +65,7 @@ bool MatchedFilter::execute_once(
|
||||
}
|
||||
|
||||
void MatchedFilter::shift_by_decimation_factor() {
|
||||
std::move(&samples_[decimation_factor], &samples_[taps_count_], &samples_[0]);
|
||||
std::move(&samples_[decimation_factor_], &samples_[taps_count_], &samples_[0]);
|
||||
}
|
||||
|
||||
} /* namespace matched_filter */
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
samples_ = std::make_unique<samples_t>(taps.size());
|
||||
taps_reversed_ = std::make_unique<taps_t>(taps.size());
|
||||
taps_count_ = taps.size();
|
||||
decimation_factor = decimation_factor;
|
||||
decimation_factor_ = decimation_factor;
|
||||
std::reverse_copy(taps.cbegin(), taps.cend(), &taps_reversed_[0]);
|
||||
}
|
||||
|
||||
@ -67,14 +67,14 @@ private:
|
||||
std::unique_ptr<samples_t> samples_;
|
||||
std::unique_ptr<taps_t> taps_reversed_;
|
||||
size_t taps_count_ { 0 };
|
||||
size_t decimation_factor { 1 };
|
||||
size_t decimation_factor_ { 1 };
|
||||
size_t decimation_phase { 0 };
|
||||
float output;
|
||||
|
||||
void shift_by_decimation_factor();
|
||||
|
||||
void advance_decimation_phase() {
|
||||
decimation_phase = (decimation_phase + 1) % decimation_factor;
|
||||
decimation_phase = (decimation_phase + 1) % decimation_factor_;
|
||||
}
|
||||
|
||||
bool is_new_decimation_cycle() {
|
||||
|
Loading…
Reference in New Issue
Block a user