This commit is contained in:
furrtek
2016-05-09 21:05:11 +02:00
parent 8523bd860e
commit 569f299f42
57 changed files with 1155 additions and 772 deletions
+15 -10
View File
@@ -34,23 +34,16 @@ CaptureProcessor::CaptureProcessor() {
constexpr size_t decim_1_input_fs = decim_0_output_fs;
constexpr size_t decim_1_output_fs = decim_1_input_fs / decim_1.decimation_factor;
const auto& channel_filter = decim_1_filter;
constexpr size_t channel_filter_input_fs = decim_1_output_fs;
constexpr size_t channel_decimation = 1;
const size_t channel_filter_output_fs = channel_filter_input_fs / channel_decimation;
decim_0.configure(decim_0_filter.taps, 33554432);
decim_1.configure(decim_1_filter.taps, 131072);
channel_filter_pass_f = channel_filter.pass_frequency_normalized * channel_filter_input_fs;
channel_filter_stop_f = channel_filter.stop_frequency_normalized * channel_filter_input_fs;
channel_filter_pass_f = decim_1_filter.pass_frequency_normalized * decim_1_input_fs;
channel_filter_stop_f = decim_1_filter.stop_frequency_normalized * decim_1_input_fs;
spectrum_interval_samples = channel_filter_output_fs / spectrum_rate_hz;
spectrum_interval_samples = decim_1_output_fs / spectrum_rate_hz;
spectrum_samples = 0;
channel_spectrum.set_decimation_factor(1);
stream = std::make_unique<StreamInput>(15);
}
void CaptureProcessor::execute(const buffer_c8_t& buffer) {
@@ -81,7 +74,19 @@ void CaptureProcessor::on_message(const Message* const message) {
channel_spectrum.on_message(message);
break;
case Message::ID::CaptureConfig:
capture_config(*reinterpret_cast<const CaptureConfigMessage*>(message));
break;
default:
break;
}
}
void CaptureProcessor::capture_config(const CaptureConfigMessage& message) {
if( message.config ) {
stream = std::make_unique<StreamInput>(message.config);
} else {
stream.reset();
}
}