From 26925b3a0928ebe545046d95fc314c36789fa15f Mon Sep 17 00:00:00 2001 From: c vw Date: Thu, 12 Nov 2020 19:15:01 +0100 Subject: [PATCH] Add extra 15db mic gain in FM. --- transmitter.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/transmitter.c b/transmitter.c index b763e61..cf766a5 100644 --- a/transmitter.c +++ b/transmitter.c @@ -1060,6 +1060,19 @@ static void full_tx_buffer(TRANSMITTER *tx) { } else { update_vox(tx); + // + // DL1YCF: + // Experience tells that MicGain in FM needs about 15 dB + // more than in SSB, so add that (fixed amount of) gain here + // This possibly comes from FM pre-emphasis but is completely + // heuristic here. We have do do this *after* update_vox(). + // + if (tx->mode == modeFMN && !tune) { + for (int i=0; i<2*tx->samples; i+=2) { + tx->mic_input_buffer[i] *= 5.6234; // 20*Log(5.6234) is 15 + } + } + fexchange0(tx->id, tx->mic_input_buffer, tx->iq_output_buffer, &error); if(error!=0) { fprintf(stderr,"full_tx_buffer: id=%d fexchange0: error=%d\n",tx->id,error); -- 2.45.2