More Analog Manual Audio Gain Tweaks;

This commit is contained in:
lwvmobile 2024-03-22 15:55:09 -04:00
parent 076b9fbf04
commit b6fc17c506
4 changed files with 10 additions and 11 deletions

View File

@ -1425,7 +1425,7 @@ void analog_gain (dsd_opts * opts, dsd_state * state, short * input, int len)
int i;
UNUSED(state);
float gain = (opts->audio_gainA / 100.0f) * 3.0f; //scale 0x - 3x
float gain = (opts->audio_gainA / 100.0f) * 5.0f; //scale 0x - 5x
for (i = 0; i < len; i++)
input[i] *= gain;

View File

@ -583,7 +583,7 @@ initOpts (dsd_opts * opts)
opts->mbe_out_fR = NULL; //second slot on a TDMA system
opts->audio_gain = 0;
opts->audio_gainR = 0;
opts->audio_gainA = 30.0f; //scale of 1 - 100
opts->audio_gainA = 20.0f; //scale of 1 - 100
opts->audio_out = 1;
opts->wav_out_file[0] = 0;
opts->wav_out_fileR[0] = 0;

View File

@ -278,9 +278,6 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
sf_write_sync (opts->wav_out_raw);
}
//manual gain control
analog_gain (opts, state, state->analog_out, 960);
//low pass filter
// lpf(state, state->analog_out, 960);
@ -290,6 +287,9 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
//pass band filter
pbf(state, state->analog_out, 960);
//manual gain control
analog_gain (opts, state, state->analog_out, 960);
//Running RMS after filtering does remove the analog spike from the RMS value
//but noise floor noise will still produce higher values
// if (opts->audio_in_type != 3 && opts->monitor_input_audio == 1)

View File

@ -214,12 +214,6 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
if (state->dmr_payload_p > state->dmr_payload_buf + 900000)
state->dmr_payload_p = state->dmr_payload_buf + 200;
//manual gain control
analog_gain (opts, state, analog1, 960);
analog_gain (opts, state, analog2, 960);
analog_gain (opts, state, analog3, 960);
// low pass filter
// lpf (state, analog1, 960);
// lpf (state, analog2, 960);
@ -235,6 +229,11 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
pbf (state, analog2, 960);
pbf (state, analog3, 960);
//manual gain control
analog_gain (opts, state, analog1, 960);
analog_gain (opts, state, analog2, 960);
analog_gain (opts, state, analog3, 960);
//NOTE: Ideally, we would run raw_rms for TCP/VS here, but the analog spike on EDACS (STM)
//system gets filtered out, and when they hold the radio open and don't talk,
//it counts against the squelch hit as no audio, so we will just have to use