Simplify some silly math.

This commit is contained in:
Jared Boone 2016-02-10 11:23:41 -08:00
parent d125a5c662
commit b0e76191d7
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
channel_filter.configure(message.channel_filter.taps, channel_filter_decimation_factor); channel_filter.configure(message.channel_filter.taps, channel_filter_decimation_factor);
channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs; channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs;
channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs; channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs;
channel_spectrum.set_decimation_factor(std::floor((channel_filter_output_fs / 2) / ((channel_filter_pass_f + channel_filter_stop_f) / 2))); channel_spectrum.set_decimation_factor(std::floor(channel_filter_output_fs / (channel_filter_pass_f + channel_filter_stop_f)));
modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB); modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB);
audio_output.configure(message.audio_hpf_config); audio_output.configure(message.audio_hpf_config);

View File

@ -76,7 +76,7 @@ void NarrowbandFMAudio::configure(const NBFMConfigureMessage& message) {
demod.configure(demod_input_fs, message.deviation); demod.configure(demod_input_fs, message.deviation);
channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs; channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs;
channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs; channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs;
channel_spectrum.set_decimation_factor(std::floor((channel_filter_output_fs / 2) / ((channel_filter_pass_f + channel_filter_stop_f) / 2))); channel_spectrum.set_decimation_factor(std::floor(channel_filter_output_fs / (channel_filter_pass_f + channel_filter_stop_f)));
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config, 12288); audio_output.configure(message.audio_hpf_config, message.audio_deemph_config, 12288);
configured = true; configured = true;