mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-22 09:17:29 +00:00
Recovered lost ctcss/roger beep/correct mic gain in mic app from 1.5.1 without ALC (Auto mic Limit Control-AK) (#633)
* Update spectrum_collector.cpp lower case correction * Update spectrum_collector.cpp Description changed , better explanation. * Revert "Update spectrum_collector.cpp" This reverts commit4a6fc35384
. * Revert "Update spectrum_collector.cpp" This reverts commit35cece1cb0
. * Revert "Solving Compile error on gcc10 . Keeping same safety protection about the size of the array ,but with slightly different sintax." This reverts commitf4db4e2b53
. * Recovered CTCSS-Roger_beep-MIC-GAIN from 1.5.1 * Temporary removing ALC-( for AK4951 platorm)
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "dsp_types.hpp"
|
||||
#include "dsp_hilbert.hpp"
|
||||
#include "tone_gen.hpp"
|
||||
#include "baseband_processor.hpp"
|
||||
|
||||
namespace dsp {
|
||||
namespace modulate {
|
||||
@@ -41,13 +43,28 @@ enum class Mode {
|
||||
|
||||
class Modulator {
|
||||
public:
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer) = 0;
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer,bool& configured_in, uint32_t& new_beep_index, uint32_t& new_beep_timer, TXProgressMessage& new_txprogress_message, AudioLevelReportMessage& new_level_message, uint32_t& new_power_acc_count, uint32_t& new_divider ) = 0;
|
||||
virtual ~Modulator();
|
||||
|
||||
Mode get_mode();
|
||||
void set_mode(Mode new_mode);
|
||||
|
||||
void set_over(uint32_t new_over);
|
||||
void set_gain_vumeter_beep(float new_audio_gain , bool new_play_beep );
|
||||
int32_t apply_beep(int32_t sample_in, bool& configured_in, uint32_t& new_beep_index, uint32_t& new_beep_timer, TXProgressMessage& new_txprogress_message );
|
||||
float audio_gain { };
|
||||
bool play_beep { false };
|
||||
uint32_t power_acc_count { 0 }; // this var it is initialized from Proc_mictx.cpp
|
||||
uint32_t divider { }; // this var it is initialized from Proc_mictx.cpp
|
||||
uint64_t power_acc { 0 }; // it is aux Accumulated sum (Absolute sample signal) , initialitzed to zero.
|
||||
AudioLevelReportMessage level_message { };
|
||||
|
||||
private:
|
||||
static constexpr size_t baseband_fs = 1536000U;
|
||||
TXProgressMessage txprogress_message { };
|
||||
ToneGen beep_gen { };
|
||||
uint32_t beep_index { }, beep_timer { };
|
||||
|
||||
|
||||
protected:
|
||||
uint32_t over = 1;
|
||||
@@ -60,7 +77,7 @@ class SSB : public Modulator {
|
||||
public:
|
||||
SSB();
|
||||
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer);
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer, bool& configured_in, uint32_t& new_beep_index, uint32_t& new_beep_timer, TXProgressMessage& new_txprogress_message, AudioLevelReportMessage& new_level_message, uint32_t& new_power_acc_count, uint32_t& new_divider );
|
||||
|
||||
private:
|
||||
dsp::HilbertTransform hilbert;
|
||||
@@ -72,8 +89,9 @@ class FM : public Modulator {
|
||||
public:
|
||||
FM();
|
||||
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer);
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer, bool& configured_in, uint32_t& new_beep_index, uint32_t& new_beep_timer, TXProgressMessage& new_txprogress_message, AudioLevelReportMessage& new_level_message, uint32_t& new_power_acc_count, uint32_t& new_divider ) ;
|
||||
void set_fm_delta(uint32_t new_delta);
|
||||
void set_tone_gen_configure(const uint32_t delta, const float tone_mix_weight);
|
||||
|
||||
///
|
||||
|
||||
@@ -81,13 +99,16 @@ private:
|
||||
uint32_t fm_delta { 0 };
|
||||
uint32_t phase { 0 }, sphase { 0 };
|
||||
int32_t sample { 0 }, delta { };
|
||||
ToneGen tone_gen { };
|
||||
|
||||
|
||||
};
|
||||
|
||||
class AM : public Modulator {
|
||||
public:
|
||||
AM();
|
||||
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer);
|
||||
virtual void execute(const buffer_s16_t& audio, const buffer_c8_t& buffer, bool& configured_in, uint32_t& new_beep_index, uint32_t& new_beep_timer, TXProgressMessage& new_txprogress_message, AudioLevelReportMessage& new_level_message, uint32_t& new_power_acc_count, uint32_t& new_divider );
|
||||
};
|
||||
|
||||
} /* namespace modulate */
|
||||
|
Reference in New Issue
Block a user