From 7cf9fe0816aeb9e0ec3eeac97de41e6d65e978e0 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 7 Jul 2014 23:06:06 +0200 Subject: Increase UHD normalisation to 50000 --- src/DabMod.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 92f07eb..6e41dd2 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -684,7 +684,17 @@ int main(int argc, char* argv[]) } #if defined(HAVE_OUTPUT_UHD) else if (useUHDOutput) { - normalise = 1.0f/32768.0f; + + /* UHD requires the input I and Q samples to be in the interval + * [-1.0,1.0], otherwise they get truncated, which creates very + * wide-spectrum spikes. Depending on the Transmission Mode, the + * Gain Mode and the sample rate (and maybe other parameters), the + * samples can have peaks up to about 48000. The value of 50000 + * should guarantee that with a digital gain of 1.0, UHD never clips + * our samples. + */ + normalise = 1.0f/50000.0f; + outputuhd_conf.sampleRate = outputRate; try { output = new OutputUHD(outputuhd_conf, logger); -- cgit v1.2.3