summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-07-07 23:06:06 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-07-07 23:06:06 +0200
commit7cf9fe0816aeb9e0ec3eeac97de41e6d65e978e0 (patch)
tree7d89f204ccb337374add8642279717e4de2318f6
parent6634cb1f64518d818306f35154e287b7f997b25e (diff)
downloaddabmod-7cf9fe0816aeb9e0ec3eeac97de41e6d65e978e0.tar.gz
dabmod-7cf9fe0816aeb9e0ec3eeac97de41e6d65e978e0.tar.bz2
dabmod-7cf9fe0816aeb9e0ec3eeac97de41e6d65e978e0.zip
Increase UHD normalisation to 50000
-rw-r--r--src/DabMod.cpp12
1 files changed, 11 insertions, 1 deletions
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);