mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-02 03:26:40 -04:00
Display CTCSS tone freq in Audio, Recon, and Level apps (#1231)
* Generate CTCSS messages at fixed rate regardless of tone freq * Generate CTCSS messages at fixed rate regardless of tone freq * Function for generating CTCSS description strings * Function for generating CTCSS description strings * Increase width of CTCSS text to include tone freq * Increase width of CTCSS text field to include frequency * Use CTCSS tone freq when saving HAM freqs to freq file * Use function in tone_key.cpp for displaying CTCSS string * Use function in tone_key.cpp for CTCSS descr strings * Use function in tone_key.cpp for CTCSS descr strings * Clang test * Clang * Clang * Support for reading CTCSS tones from FreqMan file * Clang * Clean up and eliminate floating point * Clean up and eliminate floating point * Corrected CTCSS field length * Corrected CTCSS field length * Clang
This commit is contained in:
parent
44dd8fd083
commit
80c769b97d
12 changed files with 174 additions and 126 deletions
|
@ -53,7 +53,9 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
|||
if (ctcss_detect_enabled) {
|
||||
/* 24kHz int16_t[16]
|
||||
* -> FIR filter, <300Hz pass, >300Hz stop, gain of 1
|
||||
* -> 12kHz int16_t[8] */
|
||||
* -> 12kHz int16_t[8]
|
||||
*
|
||||
* Note we're only processing a small section of the wave each time this fn is called */
|
||||
auto audio_ctcss = ctcss_filter.execute(audio, work_audio_buffer);
|
||||
|
||||
// s16 to f32 for hpf
|
||||
|
@ -79,9 +81,11 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
|||
prev_sample = cur_sample;
|
||||
}
|
||||
|
||||
if (z_count >= 30) {
|
||||
z_filter_count++;
|
||||
if ((z_filter_count >= Z_MIN_FILTER_COUNT) && (z_count >= Z_MIN_ZERO_CROSSINGS)) {
|
||||
ctcss_message.value = (100 * 12000 / 2 * z_count) / z_acc;
|
||||
shared_memory.application_queue.push(ctcss_message);
|
||||
z_filter_count = 0;
|
||||
z_count = 0;
|
||||
z_acc = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue