aboutsummaryrefslogtreecommitdiffstats
path: root/dpd
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-08-17 16:28:13 +0200
committerandreas128 <Andreas>2017-08-17 16:28:13 +0200
commit4fe5b4cacad22c84110061cb1cce4c0cf29b79fa (patch)
tree82c7d94d7301fcd5b4cacb92bf6ad55340a1251d /dpd
parent2d70a92c178b4cf7460d09efd93a0e7918781a64 (diff)
downloaddabmod-4fe5b4cacad22c84110061cb1cce4c0cf29b79fa.tar.gz
dabmod-4fe5b4cacad22c84110061cb1cce4c0cf29b79fa.tar.bz2
dabmod-4fe5b4cacad22c84110061cb1cce4c0cf29b79fa.zip
Fix plotting without DISPLAY
Diffstat (limited to 'dpd')
-rw-r--r--dpd/dpd.ini2
-rwxr-xr-xdpd/main.py2
-rw-r--r--dpd/src/Dab_Util.py14
-rw-r--r--dpd/src/Measure.py4
-rw-r--r--dpd/src/Model.py2
5 files changed, 20 insertions, 4 deletions
diff --git a/dpd/dpd.ini b/dpd/dpd.ini
index 08564d9..64b7918 100644
--- a/dpd/dpd.ini
+++ b/dpd/dpd.ini
@@ -36,7 +36,7 @@ filename=dpd.iq
device=
master_clock_rate=32768000
type=b200
-txgain=70
+txgain=15
channel=13C
refclk_source=internal
pps_source=none
diff --git a/dpd/main.py b/dpd/main.py
index d7e2706..854f789 100755
--- a/dpd/main.py
+++ b/dpd/main.py
@@ -35,7 +35,7 @@ parser.add_argument('--samplerate', default='8192000',
parser.add_argument('--coefs', default='dpdpoly.coef',
help='File with DPD coefficients, which will be read by ODR-DabMod',
required=False)
-parser.add_argument('--samps', default='10240',
+parser.add_argument('--samps', default='2560',
help='Number of samples to request from ODR-DabMod',
required=False)
diff --git a/dpd/src/Dab_Util.py b/dpd/src/Dab_Util.py
index aee66d2..212175c 100644
--- a/dpd/src/Dab_Util.py
+++ b/dpd/src/Dab_Util.py
@@ -2,7 +2,10 @@
import numpy as np
import scipy
+import matplotlib
+matplotlib.use('agg')
import matplotlib.pyplot as plt
+import datetime
import src.subsample_align as sa
from scipy import signal
import logging
@@ -27,7 +30,16 @@ class Dab_Util:
sig_rec: The signal that has been recored
"""
off = sig_rec.shape[0]
- c = np.abs(signal.correlate(sig_orig, sig_rec))
+ c = signal.correlate(sig_orig, sig_rec)
+
+ corr_path = ('/tmp/tx_rx_corr_' +
+ datetime.datetime.now().isoformat() +
+ '.pdf')
+ plt.plot(np.real(c[:10000]), label="corr")
+ plt.legend()
+ plt.savefig(corr_path)
+ plt.clf()
+
return np.argmax(c) - off + 1
def lag_upsampling(self, sig_orig, sig_rec, n_up):
diff --git a/dpd/src/Measure.py b/dpd/src/Measure.py
index 7b5379d..49e2431 100644
--- a/dpd/src/Measure.py
+++ b/dpd/src/Measure.py
@@ -4,6 +4,8 @@ import sys
import socket
import struct
import numpy as np
+import matplotlib
+matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import argparse
@@ -116,7 +118,7 @@ class Measure:
% (len(txframe), txframe.dtype, len(rxframe), rxframe.dtype,
len(txframe_aligned), txframe_aligned.dtype, len(rxframe_aligned), rxframe_aligned.dtype) )
- return txframe_aligned, rxframe_aligned
+ return txframe_aligned, None, rxframe_aligned, None
# The MIT License (MIT)
#
diff --git a/dpd/src/Model.py b/dpd/src/Model.py
index 9ad7532..008dc1b 100644
--- a/dpd/src/Model.py
+++ b/dpd/src/Model.py
@@ -3,6 +3,8 @@
import numpy as np
import datetime
import logging
+import matplotlib
+matplotlib.use('agg')
import matplotlib.pyplot as plt
class Model: