mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Simplify some silly math.
This commit is contained in:
parent
d125a5c662
commit
b0e76191d7
@ -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);
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user