From 9ef58b7763db23b492c12f3c34bd325704fd8863 Mon Sep 17 00:00:00 2001 From: Brumi-2021 <86470699+Brumi-2021@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:11:12 +0200 Subject: [PATCH] updating_comments (#2191) --- firmware/application/apps/ui_mictx.cpp | 2 +- firmware/baseband/dsp_hilbert.cpp | 4 ++-- firmware/baseband/dsp_modulate.cpp | 11 +++-------- firmware/baseband/proc_mictx.cpp | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/firmware/application/apps/ui_mictx.cpp b/firmware/application/apps/ui_mictx.cpp index ee5f2aee9..dfa80a65a 100644 --- a/firmware/application/apps/ui_mictx.cpp +++ b/firmware/application/apps/ui_mictx.cpp @@ -285,7 +285,7 @@ void MicTXView::set_rxbw_defaults(bool use_app_settings) { // Initially in that field_rxbw.set_by_value(0); } else if ((mic_mod_index == MIC_MOD_USB) | (mic_mod_index == MIC_MOD_LSB)) { field_bw.set_value(3); // In SSB by default let's limit TX_BW to 3kHz. - field_bw.set_range(2, 3); // User range to modify that TX_BW. (TODO pending to investigate 4khz). + field_bw.set_range(2, 3); // User TXBW GUI range to modify that SSB TX_BW to limit SSB radiated spectrum. field_bw.set_step(1); } // field_bw is hidden in other modulation cases diff --git a/firmware/baseband/dsp_hilbert.cpp b/firmware/baseband/dsp_hilbert.cpp index e2ac5a3de..642fa3d69 100644 --- a/firmware/baseband/dsp_hilbert.cpp +++ b/firmware/baseband/dsp_hilbert.cpp @@ -33,11 +33,11 @@ HilbertTransform::HilbertTransform() { } void HilbertTransform::execute(float in, float& out_i, float& out_q) { + // Synthesized Hilbert Transform, it is implemented based on 1/2 band LPF and later freq shift fs/4, achieving a H.T_BW of transmitted = fs/2 ; + // Half_band LPF means a LP filter with f_cut_off = fs/4; Half band = Half max band = 1/2 * fs_max = 1/2 x f_Nyquist = 1/2 * fs/2 = fs/4 float a = 0, b = 0; float in_filtered = sos_input.execute(in) * 1.0f; // Anti-aliasing LPF at fs/4 mic audio filter front-end. - // it is exactly matching with the usefull mic BW_cut_off =fs/4 of the following Hilbert Transf. implementation - // Ex. to TX SSB 3khz BW (3KHZ =fs/4) ,we need to run Hiblert_Trf fs = 12khz . And our anti-aliasing filter is also fcut =fs/4 when we use a half_band_LPF . switch (n) { case 0: diff --git a/firmware/baseband/dsp_modulate.cpp b/firmware/baseband/dsp_modulate.cpp index 5e638613e..671953bd8 100644 --- a/firmware/baseband/dsp_modulate.cpp +++ b/firmware/baseband/dsp_modulate.cpp @@ -84,18 +84,13 @@ SSB::SSB() void SSB::set_fs_div_factor(float new_bw_ssb) { switch ((int)new_bw_ssb / 1000) { case 2: - fs_div_factor = 192; // TXBW_ssb = 2khz = fs/4 ; fs of Hilbert Transform => 8khz fs Hilbert = 1536.000/8000= 192 + fs_div_factor = 192; // TXBW_ssb = 2khz = BW_cut_off LPF = fs/4 ; BW_HT fs Hilbert Transform (4khz=fs/2) ==> (8k=fs) Hilbert_fs = 1.536.000/8000= 192 break; case 3: - fs_div_factor = 128; // TXBW_ssb = 3khz = fs/4 ; fs of Hilbert Transform => 12khz fs Hilbert = 1536.000/12000= 128 + fs_div_factor = 128; // TXBW_ssb = 3khz = BW_cut_off LPF = fs/4 ; BW_HT fs Hilbert Transform (6khz=fs/2) ==> (12k=fs) Hilbert_fs = 1.536.000/12000= 128 break; - /* TODO pending to investigate 4khz, now is making aliasing folding with audio sweep . - case 4: - fs_div_factor = 96; // TXBW_ssb = 4khz = fs/4 ; fs of Hilbert Transform => 16khz fs Hilbert = 1536.000/16000= 96 - break; - */ default: - fs_div_factor = 128; // TXBW_ssb = 3khz = fs/4 ; fs of Hilbert Transform => 12khz fs Hilbert = 1536.000/12000= 128 + fs_div_factor = 128; // TXBW_ssb = 3khz = BW_cut_off LPF = fs/4 ; BW_HT fs Hilbert Transform (6khz=fs/2) ==> (12k=fs) Hilbert_fs = 1.536.000/12000= 128 break; } } diff --git a/firmware/baseband/proc_mictx.cpp b/firmware/baseband/proc_mictx.cpp index 2f37fe9c0..4be4a81cb 100644 --- a/firmware/baseband/proc_mictx.cpp +++ b/firmware/baseband/proc_mictx.cpp @@ -144,7 +144,7 @@ void MicTXProcessor::on_message(const Message* const msg) { modulator->set_mode(dsp::modulate::Mode::DSB); } - modulator->set_over(baseband_fs / 24000); // Keep no change. + modulator->set_over(baseband_fs / 24000); // "over" is calculated based on relationship fs_transceiver / fs_audio_mic_capture, to be used in dsp_modulate.cpp am_enabled = config_message.am_enabled; usb_enabled = config_message.usb_enabled;