mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-11 17:19:29 +00:00
Support for 1.25MHz capture (#1418)
* Advanced draft decim /4 just waterfall ok * apply some Kall's corrections + formatting * Tidy up both decim_factors * New refine optimizations * Format issues * more format issues ...mmmm * comments update * WIP Cleanup * WIP * WIP - add variant * Use std::visit to dispatch MultiDecimator -- fluent API * Clean up comments * Merge next and fix compilation * Fix odd loop in BlockDecimator * Clean up spectrum math * Descibe spectrum update math better, more clear math. * Apply spectrum interval correction at 1.5M * Increase replay buffer to handle x4 ovs --------- Co-authored-by: Brumi-2021 <ea3hqj@gmail.com>
This commit is contained in:
@@ -69,29 +69,22 @@ class BlockDecimator {
|
||||
|
||||
set_input_sampling_rate(src.sampling_rate);
|
||||
|
||||
while (src_i < src.count) {
|
||||
for (size_t src_i = 0; src_i < src.count; src_i += factor()) {
|
||||
buffer[dst_i++] = src.p[src_i];
|
||||
if (dst_i == buffer.size()) {
|
||||
callback({buffer.data(), buffer.size(), output_sampling_rate()});
|
||||
reset_state();
|
||||
dst_i = 0;
|
||||
}
|
||||
|
||||
src_i += factor();
|
||||
}
|
||||
|
||||
src_i -= src.count;
|
||||
}
|
||||
|
||||
private:
|
||||
std::array<T, N> buffer{};
|
||||
uint32_t input_sampling_rate_{0};
|
||||
size_t factor_{1};
|
||||
size_t src_i{0};
|
||||
size_t dst_i{0};
|
||||
|
||||
void reset_state() {
|
||||
src_i = 0;
|
||||
dst_i = 0;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user