added high-pass filter in NFM mode

This commit is contained in:
AlexandreRouma
2023-03-25 19:09:27 +01:00
parent d3d245992d
commit 3420808f3a
2 changed files with 79 additions and 28 deletions

View File

@ -19,15 +19,17 @@ namespace demod {
// Load config
_config->acquire();
bool modified = false;
if (config->conf[name][getName()].contains("lowPass")) {
_lowPass = config->conf[name][getName()]["lowPass"];
}
_config->release(modified);
if (config->conf[name][getName()].contains("highPass")) {
_highPass = config->conf[name][getName()]["highPass"];
}
_config->release();
// Define structure
demod.init(input, getIFSampleRate(), bandwidth, _lowPass);
demod.init(input, getIFSampleRate(), bandwidth, _lowPass, _highPass);
}
void start() { demod.start(); }
@ -41,6 +43,12 @@ namespace demod {
_config->conf[name][getName()]["lowPass"] = _lowPass;
_config->release(true);
}
if (ImGui::Checkbox(("High Pass##_radio_wfm_highpass_" + name).c_str(), &_highPass)) {
demod.setHighPass(_highPass);
_config->acquire();
_config->conf[name][getName()]["highPass"] = _highPass;
_config->release(true);
}
}
void setBandwidth(double bandwidth) {
@ -75,6 +83,7 @@ namespace demod {
ConfigManager* _config = NULL;
bool _lowPass = true;
bool _highPass = false;
std::string name;
};