fix(dmr): raise decoded voice level

This commit is contained in:
2026-07-14 20:23:49 +03:00
parent 9755378586
commit b7dd57c64f
+2 -1
View File
@@ -190,6 +190,7 @@ const
// mbelib's floating-point API retains the signed 16-bit PCM scale. EWSDR's // mbelib's floating-point API retains the signed 16-bit PCM scale. EWSDR's
// audio outputs use normalized floating point, where full scale is +/-1.0. // audio outputs use normalized floating point, where full scale is +/-1.0.
DMR_PCM_SCALE = 1.0 / 32768.0; DMR_PCM_SCALE = 1.0 / 32768.0;
DMR_PCM_GAIN = 1.5; // +3.5 dB nominal voice level before user volume
DMR_SUPERFRAME_SAMPLES = DMR_INPUT_RATE * 360 div 1000; DMR_SUPERFRAME_SAMPLES = DMR_INPUT_RATE * 360 div 1000;
DMR_SYNC_CADENCE_TOLERANCE = DMR_SAMPLES_PER_SYM * 3; DMR_SYNC_CADENCE_TOLERANCE = DMR_SAMPLES_PER_SYM * 3;
@@ -823,7 +824,7 @@ begin
if MbeResult.ErrorsTotal > 0 then Inc(FVoiceErrorCount, MbeResult.ErrorsTotal); if MbeResult.ErrorsTotal > 0 then Inc(FVoiceErrorCount, MbeResult.ErrorsTotal);
for SampleIndex := 0 to High(PCM) do for SampleIndex := 0 to High(PCM) do
begin begin
PCM[SampleIndex] := PCM[SampleIndex] * DMR_PCM_SCALE; PCM[SampleIndex] := PCM[SampleIndex] * DMR_PCM_SCALE * DMR_PCM_GAIN;
if PCM[SampleIndex] > 1.0 then PCM[SampleIndex] := 1.0 if PCM[SampleIndex] > 1.0 then PCM[SampleIndex] := 1.0
else if PCM[SampleIndex] < -1.0 then PCM[SampleIndex] := -1.0; else if PCM[SampleIndex] < -1.0 then PCM[SampleIndex] := -1.0;
end; end;