mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 12:27:42 +00:00
Rebake of AM, NFM demodulators -- more flexible filtering/configuration.
Also make SpectrumCollector dynamically configurable. Add deemphasis filter to NFM.
This commit is contained in:
@@ -33,22 +33,27 @@
|
||||
|
||||
#include "spectrum_collector.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
|
||||
class NarrowbandAMAudio : public BasebandProcessor {
|
||||
public:
|
||||
NarrowbandAMAudio() {
|
||||
decimator.set_decimation_factor(ChannelDecimator::DecimationFactor::By32);
|
||||
channel_filter.configure(channel_filter_taps.taps, 2);
|
||||
}
|
||||
|
||||
NarrowbandAMAudio();
|
||||
|
||||
void execute(const buffer_c8_t& buffer) override;
|
||||
|
||||
void on_update_spectrum() override { channel_spectrum.update(); }
|
||||
|
||||
private:
|
||||
ChannelDecimator decimator;
|
||||
const fir_taps_real<64>& channel_filter_taps = taps_64_lp_031_070_tfilter;
|
||||
std::array<complex16_t, 512> dst;
|
||||
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0;
|
||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1;
|
||||
dsp::decimate::FIRAndDecimateComplex channel_filter;
|
||||
uint32_t channel_filter_pass_f;
|
||||
uint32_t channel_filter_stop_f;
|
||||
|
||||
dsp::demodulate::AM demod;
|
||||
|
||||
IIRBiquadFilter audio_hpf { audio_hpf_config };
|
||||
|
||||
SpectrumCollector channel_spectrum;
|
||||
|
Reference in New Issue
Block a user